Commit | Line | Data |
---|---|---|
2dd7d7a6 | 1 | #ifndef lint |
7d77e730 | 2 | static char *sccsid = "@(#)wwspawn.c 3.2 83/08/17"; |
2dd7d7a6 EW |
3 | #endif |
4 | ||
5 | #include "ww.h" | |
6 | ||
7 | wwfork(wp) | |
8 | register struct ww *wp; | |
9 | { | |
10 | switch (wp->ww_pid = fork()) { | |
11 | case -1: | |
12 | return -1; | |
13 | case 0: | |
30647f51 | 14 | moncontrol(0); |
bb05dfb5 | 15 | wp->ww_state = WWS_INCHILD; |
4711df8b | 16 | wwenviron(wp); |
2dd7d7a6 EW |
17 | return 0; |
18 | default: | |
bb05dfb5 EW |
19 | wp->ww_state = WWS_HASPROC; |
20 | (void) close(wp->ww_tty); | |
2b44d852 | 21 | wp->ww_tty = -1; |
2dd7d7a6 EW |
22 | return wp->ww_pid; |
23 | } | |
24 | } |