From 984b549864280696256cec135651770ff0b1251b Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 17 Jul 2025 00:38:04 -0400 Subject: kernel: spawn: Deprecate SPAWN_WAIT Deprecate SPAWN_WAIT in favor of waitpid() Signed-off-by: Ian Moffett --- usr.sbin/install/install.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'usr.sbin/install/install.c') diff --git a/usr.sbin/install/install.c b/usr.sbin/install/install.c index 91f75df..803c864 100644 --- a/usr.sbin/install/install.c +++ b/usr.sbin/install/install.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -85,6 +86,7 @@ pre_installer(void) char *argv[] = { "/usr/bin/osh", NULL }; char *envp[] = { NULL }; char c; + pid_t child = -1; puts("[S]hell/[I]nstall"); for (;;) { @@ -92,13 +94,17 @@ pre_installer(void) if (c == 's') { puts("\033[0m"); installer_clearscr(0x000000, false); - spawn(argv[0], argv, envp, SPAWN_WAIT); + child = spawn(argv[0], argv, envp, 0); installer_clearscr(INSTALLER_BG, true); break; } else if (c == 'i') { break; } } + + if (child > 0) { + waitpid(child, NULL, 0); + } } static void -- cgit v1.2.3