From: Martin Schwenke Date: Wed, 29 Jan 2020 05:26:03 +0000 (+1100) Subject: ctdb-daemon: Make some conditions more explicit X-Git-Tag: ldb-2.1.1~121 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a220e9454a6dd56f3b0f317d9b4361d0328ff79a;p=thirdparty%2Fsamba.git ctdb-daemon: Make some conditions more explicit These don't need to depend on do_fork. Child logging should be set up whenever the daemon is not interactive. The stdin handler should be setup whenever test mode is enabled. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index 561d24a189f..8b4c05887f9 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -1497,12 +1497,12 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, exit(1); } - if (do_fork) { + if (!interactive) { ctdb_set_child_logging(ctdb); } /* Exit if stdin is closed */ - if (!do_fork) { + if (test_mode_enabled) { ret = setup_stdin_handler(ctdb); if (ret != 0) { DBG_ERR("Failed to setup stdin handler\n");