summaryrefslogtreecommitdiff
path: root/ctdb/common/sock_daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctdb/common/sock_daemon.c')
-rw-r--r--ctdb/common/sock_daemon.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ctdb/common/sock_daemon.c b/ctdb/common/sock_daemon.c
index 03d3ac1f1ec..86cc2f2e502 100644
--- a/ctdb/common/sock_daemon.c
+++ b/ctdb/common/sock_daemon.c
@@ -517,9 +517,15 @@ int sock_daemon_add_unix(struct sock_daemon_context *sockd,
return 0;
}
-void sock_daemon_set_startup_fd(struct sock_daemon_context *sockd, int fd)
+bool sock_daemon_set_startup_fd(struct sock_daemon_context *sockd, int fd)
{
+ if (! set_close_on_exec(fd)) {
+ D_ERR("Failed to set close-on-exec on startup fd\n");
+ return false;
+ }
+
sockd->startup_fd = fd;
+ return true;
}
/*