Commit | Line | Data |
---|---|---|
2dd7d7a6 | 1 | #ifndef lint |
03e75950 | 2 | static char *sccsid = "@(#)wwspawn.c 3.3 83/08/26"; |
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: | |
03e75950 | 12 | wwerrno = WWE_SYS; |
2dd7d7a6 EW |
13 | return -1; |
14 | case 0: | |
30647f51 | 15 | moncontrol(0); |
bb05dfb5 | 16 | wp->ww_state = WWS_INCHILD; |
4711df8b | 17 | wwenviron(wp); |
2dd7d7a6 EW |
18 | return 0; |
19 | default: | |
bb05dfb5 EW |
20 | wp->ww_state = WWS_HASPROC; |
21 | (void) close(wp->ww_tty); | |
2b44d852 | 22 | wp->ww_tty = -1; |
2dd7d7a6 EW |
23 | return wp->ww_pid; |
24 | } | |
25 | } |