]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-daemon: Clean up call to bind socket
authorMartin Schwenke <martin@meltin.net>
Sat, 24 Oct 2020 10:54:21 +0000 (21:54 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 2 Nov 2020 08:58:31 +0000 (08:58 +0000)
Variable res is only used once and ret is re-used many times.  Drop
res, use ret, which doesn't need to be initialised.  Modernise debug
macro.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
ctdb/server/ctdb_daemon.c

index 149f191b4649749020de2c760ca2b7d452cee8d0..abe47fd231115e859d91d274951ab8989ae8036c 100644 (file)
@@ -1470,7 +1470,7 @@ int ctdb_start_daemon(struct ctdb_context *ctdb,
                      bool interactive,
                      bool test_mode_enabled)
 {
-       int res, ret = -1;
+       int ret;
        struct tevent_fd *fde;
 
        /* Fork if not interactive */
@@ -1493,9 +1493,9 @@ int ctdb_start_daemon(struct ctdb_context *ctdb,
        ctdb_create_pidfile(ctdb);
 
        /* create a unix domain stream socket to listen to */
-       res = ux_socket_bind(ctdb);
-       if (res!=0) {
-               DEBUG(DEBUG_ALERT,("Cannot continue.  Exiting!\n"));
+       ret = ux_socket_bind(ctdb);
+       if (ret != 0) {
+               D_ERR("Cannot continue.  Exiting!\n");
                exit(10);
        }