summaryrefslogtreecommitdiff
path: root/src/shared/logs-show.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-29 18:07:00 +0100
committerLennart Poettering <lennart@poettering.net>2018-01-04 13:27:27 +0100
commit2e87a1fde9f46bee69c0980076cf6dc1f7cec7a4 (patch)
treea29438129d695c76f8326b505210963c11c5cd5e /src/shared/logs-show.c
parent1f5d1e02478fb550c926b23597895c7f1745dd9f (diff)
downloadsystemd-2e87a1fde9f46bee69c0980076cf6dc1f7cec7a4.tar.gz
systemd-2e87a1fde9f46bee69c0980076cf6dc1f7cec7a4.tar.bz2
systemd-2e87a1fde9f46bee69c0980076cf6dc1f7cec7a4.zip
tree-wide: make use of wait_for_terminate_and_check() at various places
Using wait_for_terminate_and_check() instead of wait_for_terminate() let's us simplify, shorten and unify the return value checking and logging of waitid(). Hence, let's use it all over the place.
Diffstat (limited to 'src/shared/logs-show.c')
-rw-r--r--src/shared/logs-show.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index ffb921e4a8..a861be7b32 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -1256,7 +1256,6 @@ static int get_boot_id_for_machine(const char *machine, sd_id128_t *boot_id) {
_cleanup_close_pair_ int pair[2] = { -1, -1 };
_cleanup_close_ int pidnsfd = -1, mntnsfd = -1, rootfd = -1;
pid_t pid, child;
- siginfo_t si;
char buf[37];
ssize_t k;
int r;
@@ -1308,9 +1307,11 @@ static int get_boot_id_for_machine(const char *machine, sd_id128_t *boot_id) {
pair[1] = safe_close(pair[1]);
- r = wait_for_terminate(child, &si);
- if (r < 0 || si.si_code != CLD_EXITED || si.si_status != EXIT_SUCCESS)
- return r < 0 ? r : -EIO;
+ r = wait_for_terminate_and_check("(sd-bootid)", child, 0);
+ if (r < 0)
+ return r;
+ if (r != EXIT_SUCCESS)
+ return -EIO;
k = recv(pair[0], buf, 36, 0);
if (k != 36)