aboutsummaryrefslogtreecommitdiff
path: root/toys/other/nsenter.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-09-29 05:09:46 -0500
committerRob Landley <rob@landley.net>2015-09-29 05:09:46 -0500
commit7d6af77804adc069a83e8566250f868a6cb9786e (patch)
tree92b6b57f55c41ab13164c1d448b3cdd1129703b4 /toys/other/nsenter.c
parent3b51a07e478d64a84e40b3a7c026b2f8566b194b (diff)
downloadtoybox-7d6af77804adc069a83e8566250f868a6cb9786e.tar.gz
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.
Diffstat (limited to 'toys/other/nsenter.c')
-rw-r--r--toys/other/nsenter.c13
1 files changed, 5 insertions, 8 deletions
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 <luto@amacapital.net>
+ * Copyright 2014 Andy Lutomirski <luto@amacapital.net>
*
- * No standard
+ * See http://man7.org/linux/man-pages/man1/nsenter.1.html
*
* unshare.c - run command in new context
*
* Copyright 2011 Rob Landley <rob@landley.net>
*
- * 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;
}
}