From: Lennart Poettering Date: Fri, 15 Dec 2017 17:51:54 +0000 (+0100) Subject: main: do bother with uid_to_name() unless we do debug logging X-Git-Tag: v237~209^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9e90f3aa6af0ee5b59bbf249ec852d56e814c83;p=thirdparty%2Fsystemd.git main: do bother with uid_to_name() unless we do debug logging --- diff --git a/src/core/main.c b/src/core/main.c index 28621ae38bb..ab9f3db2767 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1889,11 +1889,13 @@ static void log_execution_mode(bool *ret_first_boot) { log_info("Running with unpopulated /etc."); } } else { - _cleanup_free_ char *t; + if (DEBUG_LOGGING) { + _cleanup_free_ char *t; - t = uid_to_name(getuid()); - log_debug(PACKAGE_STRING " running in %suser mode for user " UID_FMT "/%s. (" SYSTEMD_FEATURES ")", - arg_action == ACTION_TEST ? " test" : "", getuid(), strna(t)); + t = uid_to_name(getuid()); + log_debug(PACKAGE_STRING " running in %suser mode for user " UID_FMT "/%s. (" SYSTEMD_FEATURES ")", + arg_action == ACTION_TEST ? " test" : "", getuid(), strna(t)); + } *ret_first_boot = false; }