comparison libpwon/forkoff.c @ 736:7d1df6d831e4

libpwon: added -Pdtr and -Prts support for DUART28C
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 16 Sep 2020 03:40:51 +0000
parents cef70d53fc5e
children ab54957dbe35
comparison
equal deleted inserted replaced
735:5b8287c655cf 736:7d1df6d831e4
3 #include <stdio.h> 3 #include <stdio.h>
4 #include <stdlib.h> 4 #include <stdlib.h>
5 #include <unistd.h> 5 #include <unistd.h>
6 6
7 extern char bootctrl_pwon_cmd[]; 7 extern char bootctrl_pwon_cmd[];
8 extern int bootctrl_duart28c_mode;
8 9
9 static char shell_pathname[] = "/bin/sh"; 10 static char shell_pathname[] = "/bin/sh";
10 11
11 void 12 void
12 fork_exec_pwon_cmd() 13 fork_exec_pwon_cmd()
25 _exit(1); 26 _exit(1);
26 } 27 }
27 28
28 pwon_if_needed() 29 pwon_if_needed()
29 { 30 {
30 if (!bootctrl_pwon_cmd[0]) 31 if (bootctrl_duart28c_mode) {
31 return(0); 32 signal(SIGCHLD, SIG_IGN);
32 signal(SIGCHLD, SIG_IGN); 33 fork_duart28c_pulse();
33 fork_exec_pwon_cmd(); 34 return(1);
34 return(1); 35 }
36 if (bootctrl_pwon_cmd[0]) {
37 signal(SIGCHLD, SIG_IGN);
38 fork_exec_pwon_cmd();
39 return(1);
40 }
41 return(0);
35 } 42 }