From 7d6af77804adc069a83e8566250f868a6cb9786e Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 29 Sep 2015 05:09:46 -0500 Subject: Make defconfig build for nommu. Adds XVFORK() macro, teaches xpopen_both() to call /proc/self/exe with NULL argv (and converts cpio -p to use that), adds TOYBOX_FORK guards to some unconverted commands. --- toys/other/nsenter.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'toys/other/nsenter.c') diff --git a/toys/other/nsenter.c b/toys/other/nsenter.c index 18a2cd21..bda77ac1 100644 --- a/toys/other/nsenter.c +++ b/toys/other/nsenter.c @@ -1,14 +1,14 @@ /* nsenter.c - Enter existing namespaces * - * Copyright 2014 andy Lutomirski + * Copyright 2014 Andy Lutomirski * - * No standard + * See http://man7.org/linux/man-pages/man1/nsenter.1.html * * unshare.c - run command in new context * * Copyright 2011 Rob Landley * - * No Standard + * See http://man7.org/linux/man-pages/man1/unshare.1.html * // Note: flags go in same order (right to left) for shared subset @@ -149,12 +149,9 @@ void unshare_main(void) } if ((toys.optflags & FLAG_p) && !(toys.optflags & FLAG_F)) { - pid_t pid = xfork(); + toys.exitval = xrun(toys.optargs); - if (pid) { - while (waitpid(pid, 0, 0) == -1 && errno == EINTR); - return; - } + return; } } -- cgit v1.2.3