From 7f7907f53ecaeabb00929feb0ede85a456683ddc Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 5 Sep 2016 00:52:44 -0500 Subject: Export notstdio() wrapper. --- lib/xwrap.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/xwrap.c') 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); -- cgit v1.2.3