projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1454 from rubenk/libi2c-dev-mark-as-linux-only
[collectd.git]
/
src
/
unixsock.c
diff --git
a/src/unixsock.c
b/src/unixsock.c
index
664c018
..
54a1e20
100644
(file)
--- a/
src/unixsock.c
+++ b/
src/unixsock.c
@@
-39,7
+39,6
@@
/* Folks without pthread will need to disable this plugin. */
#include <pthread.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>
@@
-128,7
+127,16
@@
static int us_open_socket (void)
return (-1);
}
return (-1);
}
- chmod (sa.sun_path, sock_perms);
+ status = chmod (sa.sun_path, sock_perms);
+ if (status == -1)
+ {
+ char errbuf[1024];
+ ERROR ("unixsock plugin: chmod failed: %s",
+ sstrerror (errno, errbuf, sizeof (errbuf)));
+ close (sock_fd);
+ sock_fd = -1;
+ return (-1);
+ }
status = listen (sock_fd, 8);
if (status != 0)
status = listen (sock_fd, 8);
if (status != 0)