diff options
author | Rob Landley <rob@landley.net> | 2014-05-31 12:33:24 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2014-05-31 12:33:24 -0500 |
commit | d8872c43b48eae5501998a4e5a84337017d8fbe6 (patch) | |
tree | 8360d8673d0ed40b02f9d58bdf74b639f6e780f9 /toys/pending/openvt.c | |
parent | b0d97a0059555cb0e7e0009b72c038aa67aaa769 (diff) | |
download | toybox-d8872c43b48eae5501998a4e5a84337017d8fbe6.tar.gz |
Introduce xfork() and make commands use it, and make some WEXITSTATUS() use WIFEXITED() and WTERMSIG()+127.
Diffstat (limited to 'toys/pending/openvt.c')
-rw-r--r-- | toys/pending/openvt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/toys/pending/openvt.c b/toys/pending/openvt.c index f136b1b7..be3070e2 100644 --- a/toys/pending/openvt.c +++ b/toys/pending/openvt.c @@ -110,9 +110,8 @@ void openvt_main(void) while (vt_fd > 2) close(vt_fd--); - pid = vfork(); - if (pid < 0) perror_exit("Fork failed"); - else if (!pid) { + pid = xfork(); + if (!pid) { setsid(); ioctl(vt_fd, TIOCSCTTY, 0); xexec(toys.optargs); |