comparison libpwon/forkoff.c @ 575:cef70d53fc5e

loadtools: new -P boot control mechanism implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 02 Feb 2020 20:01:22 +0000
parents 41b3e010808d
children 7d1df6d831e4
comparison
equal deleted inserted replaced
574:aba969153d20 575:cef70d53fc5e
1 #include <sys/types.h> 1 #include <sys/types.h>
2 #include <signal.h>
2 #include <stdio.h> 3 #include <stdio.h>
3 #include <stdlib.h> 4 #include <stdlib.h>
4 #include <unistd.h> 5 #include <unistd.h>
5 6
6 extern char bootctrl_pwon_cmd[]; 7 extern char bootctrl_pwon_cmd[];
21 return; 22 return;
22 execl(shell_pathname, "sh", "-c", bootctrl_pwon_cmd, (char *) 0); 23 execl(shell_pathname, "sh", "-c", bootctrl_pwon_cmd, (char *) 0);
23 perror(shell_pathname); 24 perror(shell_pathname);
24 _exit(1); 25 _exit(1);
25 } 26 }
27
28 pwon_if_needed()
29 {
30 if (!bootctrl_pwon_cmd[0])
31 return(0);
32 signal(SIGCHLD, SIG_IGN);
33 fork_exec_pwon_cmd();
34 return(1);
35 }