From: Mike Yuan Date: Fri, 7 Jun 2024 21:55:43 +0000 (+0200) Subject: core/manager: enclose debug info acquirement in 'if (DEBUG_LOGGING)' X-Git-Tag: v257-rc1~1202 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bd6e5b4d93065d759bd5159d2bd9f57cb7c40d6e;p=thirdparty%2Fsystemd.git core/manager: enclose debug info acquirement in 'if (DEBUG_LOGGING)' --- diff --git a/src/core/manager.c b/src/core/manager.c index 90e72b0c025..21918a9f226 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -604,7 +604,7 @@ static int manager_setup_signals(Manager *m) { * misunderstand this as a boolean concept. Signal level 2 shall refer to the signals PID 1 * understands at the time of release of systemd v256, i.e. including basic SIGRTMIN+18 handling for * memory pressure and stuff. When more signals are hooked up (or more SIGRTMIN+18 multiplex - * operations added, this level should be increased). */ + * operations added, this level should be increased). */ (void) sd_notify(/* unset_environment= */ false, "X_SYSTEMD_SIGNALS_LEVEL=2"); @@ -1037,9 +1037,9 @@ int manager_new(RuntimeScope runtime_scope, ManagerTestRunFlags test_run_flags, r = xdg_user_runtime_dir(&units_path, "/systemd/units"); if (r < 0) return r; + r = mkdir_p_label(units_path, 0755); } - if (r < 0 && r != -EEXIST) return r; } @@ -1049,12 +1049,12 @@ int manager_new(RuntimeScope runtime_scope, ManagerTestRunFlags test_run_flags, if (m->executor_fd < 0) return log_debug_errno(m->executor_fd, "Failed to pin executor binary: %m"); - _cleanup_free_ char *executor_path = NULL; - r = fd_get_path(m->executor_fd, &executor_path); - if (r < 0) - return r; + if (DEBUG_LOGGING) { + _cleanup_free_ char *executor_path = NULL; - log_debug("Using systemd-executor binary from '%s'.", executor_path); + (void) fd_get_path(m->executor_fd, &executor_path); + log_debug("Using systemd-executor binary from '%s'.", strna(executor_path)); + } } /* Note that we do not set up the notify fd here. We do that after deserialization,