OSDN Git Service

Export notstdio() wrapper.
[android-x86/external-toybox.git] / lib / xwrap.c
index 89488ac..66972f2 100644 (file)
@@ -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);