]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:lib: Check return code of set_blocking()
authorAndreas Schneider <asn@samba.org>
Tue, 24 Nov 2020 16:42:24 +0000 (17:42 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 26 Nov 2020 06:52:41 +0000 (06:52 +0000)
Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/lib/server_prefork.c

index d3fb8d1a8bcfe27f173d58685fc9b070266d8c6e..d0cea7c30c04ce91e8713541eebb186f33d30f47 100644 (file)
@@ -84,7 +84,11 @@ bool prefork_create_pool(TALLOC_CTX *mem_ctx,
        for (i = 0; i < listen_fd_size; i++) {
                pfp->listen_fds[i] = listen_fds[i];
                /* force sockets in non-blocking mode */
-               set_blocking(listen_fds[i].fd, false);
+               ret = set_blocking(listen_fds[i].fd, false);
+               if (ret < 0) {
+                       DBG_WARNING("Failed to set sockets to non-blocking!\n");
+                       return false;
+               }
        }
        pfp->main_fn = main_fn;
        pfp->private_data = private_data;