diff --git a/src/unixsock.c b/src/unixsock.c
index 664c0184a5d21a793e1fc529dcbe6fbdddfbcde8..e62ed6c0596b5ddb29848e66805d6e5ffd036f1c 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)