main: do bother with uid_to_name() unless we do debug logging

This commit is contained in:
Lennart Poettering 2017-12-15 18:51:54 +01:00
parent 43db615ba4
commit b9e90f3aa6

View file

@ -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;
}