coredumpctl: fflush() stdout before invoking gdb

Fixes: #18936
This commit is contained in:
Lennart Poettering
2021-03-11 08:55:20 +01:00
parent c9c4899f44
commit 48f813c4aa
3 changed files with 7 additions and 1 deletions
+5
View File
@@ -1230,6 +1230,11 @@ int safe_fork_full(
original_pid = getpid_cached();
if (flags & FORK_FLUSH_STDIO) {
fflush(stdout);
fflush(stderr); /* This one shouldn't be necessary, stderr should be unbuffered anyway, but let's better be safe than sorry */
}
if (flags & (FORK_RESET_SIGNALS|FORK_DEATHSIG)) {
/* We temporarily block all signals, so that the new child has them blocked initially. This way, we can
* be sure that SIGTERMs are not lost we might send to the child. */