From d8872c43b48eae5501998a4e5a84337017d8fbe6 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 31 May 2014 12:33:24 -0500 Subject: Introduce xfork() and make commands use it, and make some WEXITSTATUS() use WIFEXITED() and WTERMSIG()+127. --- toys/pending/openvt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'toys/pending/openvt.c') 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); -- cgit v1.2.3