From: Lennart Poettering Date: Fri, 22 Oct 2021 14:37:10 +0000 (+0200) Subject: process-util: move sync() out of freeze() X-Git-Tag: v250-rc1~446^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=43cac49092ec99802d74b1d6279d4d27a4048829;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/basic/process-util.c b/src/basic/process-util.c index fce96dd5ebd..38df34e3395 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 6e01398523c..129f340f6e2 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(); }