summaryrefslogtreecommitdiff
path: root/src/shared/logs-show.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-23 19:10:11 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-23 19:10:11 +0100
commitfbadf04511389c4a0687ba5e9baf0ecebdbb07f1 (patch)
treee54a8fe180ebe121a40c70cf23024c3fee77fd3e /src/shared/logs-show.c
parente7f7a1b0222c49fd4706a77bbdac59ac28a4ddbb (diff)
bus: when getting a kdbus connection into a container wait first for child, then read message
There's no EOF generated for AF_UNIX/SOCK_DGRAM sockets, hence let's wait for the child first to see if it succeeded, only then read the socket.
Diffstat (limited to 'src/shared/logs-show.c')
-rw-r--r--src/shared/logs-show.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index 0f27c4ee41..61c3652bd5 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -1174,14 +1174,14 @@ static int get_boot_id_for_machine(const char *machine, sd_id128_t *boot_id) {
close_nointr_nofail(pair[1]);
pair[1] = -1;
- k = recv(pair[0], buf, 36, 0);
- if (k != 36)
- return -EIO;
-
r = wait_for_terminate(child, &si);
if (r < 0 || si.si_code != CLD_EXITED || si.si_status != EXIT_SUCCESS)
return r < 0 ? r : -EIO;
+ k = recv(pair[0], buf, 36, 0);
+ if (k != 36)
+ return -EIO;
+
buf[36] = 0;
r = sd_id128_from_string(buf, boot_id);
if (r < 0)