summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--daemon/socks.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/daemon/socks.c b/daemon/socks.c
index 699efcc..12c6afe 100644
--- a/daemon/socks.c
+++ b/daemon/socks.c
@@ -71,7 +71,12 @@ static int sock_create(const char *path)
return -1;
}
- chmod(sa.sun_path, 0666);
+ r = chmod(sa.sun_path, 0666);
+ if (r == -1) {
+ bxt_err("Socket '%s': chmod %d", path, errno);
+ close(fd);
+ return -1;
+ }
r = listen(fd, SOMAXCONN);
if (r == -1) {