X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Funixsock.c;h=e62ed6c0596b5ddb29848e66805d6e5ffd036f1c;hb=25b5f5c49dd50c64f41b7bf69b8e471b0ffc6f15;hp=664c0184a5d21a793e1fc529dcbe6fbdddfbcde8;hpb=f7818fbc069c641e1ae40280dbd6f33dc613ec3a;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)