summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-07-17 00:38:04 -0400
committerIan Moffett <ian@osmora.org>2025-07-17 00:39:46 -0400
commit984b549864280696256cec135651770ff0b1251b (patch)
tree454eb966509fb6c374c7f82a542ae1413fb6e2cf /usr.sbin
parent38312546574f400bdccc422c4519e49dc06719a4 (diff)
kernel: spawn: Deprecate SPAWN_WAIT
Deprecate SPAWN_WAIT in favor of waitpid() Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/init/main.c3
-rw-r--r--usr.sbin/install/install.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/init/main.c b/usr.sbin/init/main.c
index b5c4fab..e1ee4d8 100644
--- a/usr.sbin/init/main.c
+++ b/usr.sbin/init/main.c
@@ -46,6 +46,7 @@ main(int argc, char **argv)
start_argv[1] = NULL;
/* Start the login manager */
- spawn(login_argv[0], login_argv, envp, SPAWN_WAIT);
+ spawn(login_argv[0], login_argv, envp, 0);
+ for (;;);
return 0;
}
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 <sys/fbdev.h>
#include <sys/reboot.h>
#include <sys/spawn.h>
+#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <stdio.h>
@@ -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