X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Funixsock.c;h=e62ed6c0596b5ddb29848e66805d6e5ffd036f1c;hb=0a63e4493d92f7d739a1849bc65d4e971b047004;hp=664c0184a5d21a793e1fc529dcbe6fbdddfbcde8;hpb=eea01a8f212634414a21462ba79dc058dc5fb304;p=collectd.git diff --git a/src/unixsock.c b/src/unixsock.c index 664c0184..e62ed6c0 100644 --- a/src/unixsock.c +++ b/src/unixsock.c @@ -128,7 +128,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)