diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-28 00:51:19 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-01-04 13:27:27 +0100 |
commit | 7d4904fe7a14852c1469a55ec1dfdf747d829cb1 (patch) | |
tree | 0436ef0382c15c9e020ec110dde9d79c44342517 /src/nspawn/nspawn-setuid.c | |
parent | process-util: add another fork_safe() flag for enabling LOG_ERR/LOG_WARN logging (diff) | |
download | systemd-7d4904fe7a14852c1469a55ec1dfdf747d829cb1.tar.xz systemd-7d4904fe7a14852c1469a55ec1dfdf747d829cb1.zip |
process-util: rework wait_for_terminate_and_warn() to take a flags parameter
This renames wait_for_terminate_and_warn() to
wait_for_terminate_and_check(), and adds a flags parameter, that
controls how much to log: there's one flag that means we log about
abnormal stuff, and another one that controls whether we log about
non-zero exit codes. Finally, there's a shortcut flag value for logging
in both cases, as that's what we usually use.
All callers are accordingly updated. At three occasions duplicate logging
is removed, i.e. where the old function was called but logged in the
caller, too.
Diffstat (limited to 'src/nspawn/nspawn-setuid.c')
-rw-r--r-- | src/nspawn/nspawn-setuid.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nspawn/nspawn-setuid.c b/src/nspawn/nspawn-setuid.c index b1d03d2d93..cb1be273f4 100644 --- a/src/nspawn/nspawn-setuid.c +++ b/src/nspawn/nspawn-setuid.c @@ -133,7 +133,7 @@ int change_uid_gid(const char *user, char **_home) { truncate_nl(line); - wait_for_terminate_and_warn("getent passwd", pid, true); + (void) wait_for_terminate_and_check("getent passwd", pid, WAIT_LOG); x = strchr(line, ':'); if (!x) { @@ -216,7 +216,7 @@ int change_uid_gid(const char *user, char **_home) { truncate_nl(line); - wait_for_terminate_and_warn("getent initgroups", pid, true); + (void) wait_for_terminate_and_check("getent initgroups", pid, WAIT_LOG); /* Skip over the username and subsequent separator whitespace */ x = line; |