diff --git a/src/unixsock.c b/src/unixsock.c
index 2c1665fc9fcbbdffc3c91935838a720e4fbf6d6f..8b2f33914eacc3307fbc7d1b28c9c5fe032b3c74 100644 (file)
--- a/src/unixsock.c
+++ b/src/unixsock.c
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)