projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
collectd-tg: Fix sleep interval.
[collectd.git]
/
src
/
unixsock.c
diff --git
a/src/unixsock.c
b/src/unixsock.c
index
e62ed6c
..
808ba98
100644
(file)
--- a/
src/unixsock.c
+++ b/
src/unixsock.c
@@
-25,9
+25,9
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "common.h"
#include "plugin.h"
-#include "configfile.h"
#include "utils_cmd_flush.h"
#include "utils_cmd_getval.h"
#include "utils_cmd_flush.h"
#include "utils_cmd_getval.h"
@@
-36,10
+36,6
@@
#include "utils_cmd_putval.h"
#include "utils_cmd_putnotif.h"
#include "utils_cmd_putval.h"
#include "utils_cmd_putnotif.h"
-/* Folks without pthread will need to disable this plugin. */
-#include <pthread.h>
-
-#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <sys/stat.h>
#include <sys/un.h>
@@
-80,7
+76,7
@@
static pthread_t listen_thread = (pthread_t) 0;
*/
static int us_open_socket (void)
{
*/
static int us_open_socket (void)
{
- struct sockaddr_un sa;
+ struct sockaddr_un sa
= { 0 }
;
int status;
sock_fd = socket (PF_UNIX, SOCK_STREAM, 0);
int status;
sock_fd = socket (PF_UNIX, SOCK_STREAM, 0);
@@
-92,7
+88,6
@@
static int us_open_socket (void)
return (-1);
}
return (-1);
}
- memset (&sa, '\0', sizeof (sa));
sa.sun_family = AF_UNIX;
sstrncpy (sa.sun_path, (sock_file != NULL) ? sock_file : US_DEFAULT_PATH,
sizeof (sa.sun_path));
sa.sun_family = AF_UNIX;
sstrncpy (sa.sun_path, (sock_file != NULL) ? sock_file : US_DEFAULT_PATH,
sizeof (sa.sun_path));
@@
-152,7
+147,7
@@
static int us_open_socket (void)
do
{
do
{
- char *grpname;
+ c
onst c
har *grpname;
struct group *g;
struct group sg;
char grbuf[2048];
struct group *g;
struct group sg;
char grbuf[2048];
@@
-369,7
+364,7
@@
static void *us_server_thread (void __attribute__((unused)) *arg)
pthread_exit ((void *) 1);
}
pthread_exit ((void *) 1);
}
- remote_fd =
(int *) malloc (sizeof (int
));
+ remote_fd =
malloc (sizeof (*remote_fd
));
if (remote_fd == NULL)
{
char errbuf[1024];
if (remote_fd == NULL)
{
char errbuf[1024];