From: Martin Schwenke Date: Sat, 24 Oct 2020 10:54:21 +0000 (+1100) Subject: ctdb-daemon: Clean up call to bind socket X-Git-Tag: talloc-2.3.2~84 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78c3b5b6a83d934c99ac25480fbc01f9aeb198e3;p=thirdparty%2Fsamba.git ctdb-daemon: Clean up call to bind socket 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 Reviewed-by: Amitay Isaacs Reviewed-by: Volker Lendecke --- diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index 149f191b464..abe47fd2311 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -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); }