From: Volker Lendecke Date: Fri, 26 Mar 2021 17:50:00 +0000 (+0100) Subject: smbd: Factor out a bool expr into a descriptive variable X-Git-Tag: tevent-0.11.0~1329 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=23056f537c6c12e656fbccac86643088db7f14da;p=thirdparty%2Fsamba.git smbd: Factor out a bool expr into a descriptive variable Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 3ca71f4e718..45192464717 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1547,6 +1547,7 @@ extern void build_options(bool screen); int opt; poptContext pc; bool print_build_options = False; + bool serving_printers = false; struct server_id main_server_id = {0}; enum { OPT_DAEMON = 1000, @@ -2108,6 +2109,9 @@ extern void build_options(bool screen); daemon_ready("smbd"); } + serving_printers = (!lp__disable_spoolss() && + (rpc_spoolss_daemon() != RPC_DAEMON_DISABLED)); + /* only start other daemons if we are running as a daemon * -- bad things will happen if smbd is launched via inetd * and we fork a copy of ourselves here */ @@ -2125,8 +2129,7 @@ extern void build_options(bool screen); start_fssd(ev_ctx, msg_ctx, dce_ctx); } - if (!lp__disable_spoolss() && - (rpc_spoolss_daemon() != RPC_DAEMON_DISABLED)) { + if (serving_printers) { bool bgq = lp_parm_bool(-1, "smbd", "backgroundqueue", true); bool ok = printing_subsystem_init(ev_ctx, msg_ctx, @@ -2144,8 +2147,7 @@ extern void build_options(bool screen); start_mdssd(ev_ctx, msg_ctx, dce_ctx); } #endif - } else if (!lp__disable_spoolss() && - (rpc_spoolss_daemon() != RPC_DAEMON_DISABLED)) { + } else if (serving_printers) { bool ok = printing_subsystem_init(ev_ctx, msg_ctx, dce_ctx,