summaryrefslogtreecommitdiff
path: root/src/coredump
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/coredump
parent1f5d1e02478fb550c926b23597895c7f1745dd9f (diff)
downloadsystemd-2e87a1fde9f46bee69c0980076cf6dc1f7cec7a4.tar.gz
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/coredump')
-rw-r--r--src/coredump/coredumpctl.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c
index 4524d604b6..96e4a3e7e2 100644
--- a/src/coredump/coredumpctl.c
+++ b/src/coredump/coredumpctl.c
@@ -885,7 +885,6 @@ static int run_gdb(sd_journal *j) {
_cleanup_free_ char *exe = NULL, *path = NULL;
bool unlink_path = false;
const char *data;
- siginfo_t st;
size_t len;
pid_t pid;
int r;
@@ -937,13 +936,7 @@ static int run_gdb(sd_journal *j) {
_exit(EXIT_FAILURE);
}
- r = wait_for_terminate(pid, &st);
- if (r < 0) {
- log_error_errno(r, "Failed to wait for gdb: %m");
- goto finish;
- }
-
- r = st.si_code == CLD_EXITED ? st.si_status : 255;
+ r = wait_for_terminate_and_check("gdb", pid, WAIT_LOG_ABNORMAL);
finish:
(void) default_signals(SIGINT, -1);