BUG: https://bugzilla.samba.org/show_bug.cgi?id=12157
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
struct ctdb_client *client;
struct ctdb_client_pid_list *client_pid;
pid_t peer_pid = 0;
+ int ret;
memset(&addr, 0, sizeof(addr));
len = sizeof(addr);
return;
}
- set_blocking(fd, false);
+ ret = set_blocking(fd, false);
+ if (ret != 0) {
+ DEBUG(DEBUG_ERR,
+ (__location__
+ " failed to set socket non-blocking (%s)\n",
+ strerror(errno)));
+ close(fd);
+ return;
+ }
+
set_close_on_exec(fd);
DEBUG(DEBUG_DEBUG,(__location__ " Created SOCKET FD:%d to connected child\n", fd));