aboutsummaryrefslogtreecommitdiff
path: root/lib/xwrap.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2016-09-05 00:52:44 -0500
committerRob Landley <rob@landley.net>2016-09-05 00:52:44 -0500
commit7f7907f53ecaeabb00929feb0ede85a456683ddc (patch)
treee5f2752bd5b4d5109eca7022e50f491381410cc2 /lib/xwrap.c
parent19394faadb511c6f5ed015d63f6e5ba32c4fc4ca (diff)
downloadtoybox-7f7907f53ecaeabb00929feb0ede85a456683ddc.tar.gz
Export notstdio() wrapper.
Diffstat (limited to 'lib/xwrap.c')
-rw-r--r--lib/xwrap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index 89488acf..66972f2b 100644
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -357,6 +357,8 @@ int xdup(int fd)
// old one. (We should never be called with stdin/stdout/stderr closed, but...)
int notstdio(int fd)
{
+ if (fd<0) return fd;
+
while (fd<3) {
int fd2 = xdup(fd);