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.
This commit is contained in:
Lennart Poettering
2018-01-04 13:27:27 +01:00
parent b6e1fff13d
commit 7d4904fe7a
18 changed files with 64 additions and 47 deletions
+2 -2
View File
@@ -161,7 +161,7 @@ static int keyboard_load_and_wait(const char *vc, const char *map, const char *m
_exit(EXIT_FAILURE);
}
return wait_for_terminate_and_warn(KBD_LOADKEYS, pid, true);
return wait_for_terminate_and_check(KBD_LOADKEYS, pid, WAIT_LOG);
}
static int font_load_and_wait(const char *vc, const char *font, const char *map, const char *unimap) {
@@ -201,7 +201,7 @@ static int font_load_and_wait(const char *vc, const char *font, const char *map,
_exit(EXIT_FAILURE);
}
return wait_for_terminate_and_warn(KBD_SETFONT, pid, true);
return wait_for_terminate_and_check(KBD_SETFONT, pid, WAIT_LOG);
}
/*