Fix static analysis issue 43/190343/1
authorInkyun Kil <inkyun.kil@samsung.com>
Mon, 1 Oct 2018 06:39:26 +0000 (15:39 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Mon, 1 Oct 2018 06:40:20 +0000 (15:40 +0900)
- Return value

Change-Id: I9c9007a7babbf1436fbd33a08058cfd998269e0f
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
daemon/socks.c

index 699efcc..12c6afe 100644 (file)
@@ -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) {