ctdb-event: Check the return status of sock_daemon_set_startup_fd
authorAmitay Isaacs <amitay@gmail.com>
Wed, 10 Oct 2018 07:19:32 +0000 (18:19 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 22 Oct 2018 04:04:20 +0000 (06:04 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13659

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/event/event_daemon.c

index c1c6852cca543df48ea3ffbf9eb246cc4a84d93c..3cab3306b0220100e50b70fdc90819d76bcedf99 100644 (file)
@@ -244,6 +244,7 @@ int main(int argc, const char **argv)
        const char *t;
        int interactive = 0;
        int opt, ret;
+       bool ok;
 
        pc = poptGetContext(argv[0],
                            argc,
@@ -343,7 +344,11 @@ int main(int argc, const char **argv)
        }
 
        if (options.startup_fd != -1) {
-               sock_daemon_set_startup_fd(e_state->sockd, options.startup_fd);
+               ok = sock_daemon_set_startup_fd(e_state->sockd,
+                                               options.startup_fd);
+               if (!ok) {
+                       goto fail;
+               }
        }
 
        ret = sock_daemon_run(e_state->ev,