From c8917b69ed119faa0ca2decd6117abebbb2d1e5a Mon Sep 17 00:00:00 2001 From: Matheus Date: Thu, 16 Apr 2026 17:21:24 -0300 Subject: [PATCH] openrc: wait for all processes to be dead before syncing --- patches/openrc/jinx-working-patch.patch | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/patches/openrc/jinx-working-patch.patch b/patches/openrc/jinx-working-patch.patch index 174432e5..f624d05b 100644 --- a/patches/openrc/jinx-working-patch.patch +++ b/patches/openrc/jinx-working-patch.patch @@ -603,7 +603,7 @@ index c5c25c0..4bf5b54 100644 include_directories: incdir, dependencies: [rc, einfo, shared, dl_dep, selinux_dep], diff --git openrc-clean/src/openrc-init/openrc-init.c openrc-workdir/src/openrc-init/openrc-init.c -index 8fc21ca..5a4bff5 100644 +index 8fc21ca..921a1da 100644 --- openrc-clean/src/openrc-init/openrc-init.c +++ openrc-workdir/src/openrc-init/openrc-init.c @@ -56,6 +56,10 @@ static const char *rc_default_runlevel = "default"; @@ -636,9 +636,13 @@ index 8fc21ca..5a4bff5 100644 do_openrc(runlevel); if (!quiet) -@@ -140,7 +147,33 @@ static void handle_shutdown(const char *runlevel, int cmd) +@@ -139,8 +146,37 @@ static void handle_shutdown(const char *runlevel, int cmd) + if (!quiet) printf("Sending the final KILL signal\n"); kill(-1, SIGKILL); ++ ++ while (waitpid(-1, NULL, 0) > 0); ++ sync(); + +#ifdef __linux__ @@ -670,7 +674,7 @@ index 8fc21ca..5a4bff5 100644 } static void run_program(const char *prog) -@@ -308,11 +341,27 @@ int main(int argc, char **argv) +@@ -308,11 +344,27 @@ int main(int argc, char **argv) if (fifo == -1) perror("open"); @@ -699,7 +703,7 @@ index 8fc21ca..5a4bff5 100644 }; poll(pfd, FD_COUNT, -1); -@@ -361,6 +410,19 @@ int main(int argc, char **argv) +@@ -361,6 +413,19 @@ int main(int argc, char **argv) init(default_runlevel); } }