X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Funixsock.c;h=54a1e20d48aedf40a347bf901ff1718e518d00d5;hb=584f57cc8cfb14cbcc45714db5dc87304ccb2a0e;hp=e6c75a65644e7441425183fb1b041c9bb93274c0;hpb=6d64200e006f22ce3f1619251004fbe6cd674b91;p=collectd.git diff --git a/src/unixsock.c b/src/unixsock.c index e6c75a65..54a1e20d 100644 --- a/src/unixsock.c +++ b/src/unixsock.c @@ -127,7 +127,16 @@ static int us_open_socket (void) 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)