diff mbox series

Fix coverity #292156

Message ID 20200420092927.3582-1-sbabic@denx.de
State Accepted
Headers show
Series Fix coverity #292156 | expand

Commit Message

Stefano Babic April 20, 2020, 9:29 a.m. UTC
Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 core/network_thread.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/core/network_thread.c b/core/network_thread.c
index f888d76..0b8e0aa 100644
--- a/core/network_thread.c
+++ b/core/network_thread.c
@@ -136,7 +136,8 @@  int listener_create(const char *path, int type)
 			return -1;
 		}
 
-		chmod(path,  S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+		if (chmod(path,  S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) < 0)
+			WARN("chmod cannot be set on socket, error %s", strerror(errno));
 	}
 
 	if (type == SOCK_STREAM)