diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-10-22 16:37:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-10-22 16:37:10 +0200 |
commit | 43cac49092ec99802d74b1d6279d4d27a4048829 (patch) | |
tree | 736978e0c5842f9c759c3c2ccb2451d3d25babac /src | |
parent | 979b0ff2c4dbebb3c04e3bca22be18e82a631098 (diff) | |
download | systemd-43cac49092ec99802d74b1d6279d4d27a4048829.tar.gz |
process-util: move sync() out of freeze()
We are using this for creating userns namespaces, and we really
shouldn't try to sync there. Moreover the use of free() in shutdown code
doesn't need it anyway, since it just sync()ed right before anyway. Only
the third user of freeze() we have actually needs the syc(), hence do it
there and nowhere else.
Diffstat (limited to 'src')
-rw-r--r-- | src/basic/process-util.c | 2 | ||||
-rw-r--r-- | src/core/main.c | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c index fce96dd5eb..38df34e339 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -1624,8 +1624,6 @@ _noreturn_ void freeze(void) { /* Make sure nobody waits for us on a socket anymore */ (void) close_all_fds_full(NULL, 0, false); - sync(); - /* Let's not freeze right away, but keep reaping zombies. */ for (;;) { siginfo_t si = {}; diff --git a/src/core/main.c b/src/core/main.c index 6e01398523..129f340f6e 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -222,6 +222,7 @@ _noreturn_ static void freeze_or_exit_or_reboot(void) { } log_emergency("Freezing execution."); + sync(); freeze(); } |