Add a wrapper for dup2() to our system.c
authorAndrew Bartlett <abartlet@samba.org>
Sat, 20 Jul 2002 06:50:47 +0000 (06:50 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 20 Jul 2002 06:50:47 +0000 (06:50 +0000)
Andrew Bartlett
(This used to be commit b24b6307f6b40e559aec441e0ebab8f666b87d9f)

source3/lib/system.c

index 8b2ba800f53efcea927dd518f3b6f0aaa0c785b7..edda54a78d2745f04c557becbf82982ec25ee7ca 100644 (file)
@@ -1219,6 +1219,16 @@ const char *sys_dlerror(void)
 #endif
 }
 
+int sys_dup2(int oldfd, int newfd) 
+{
+#if defined(HAVE_DUP2)
+       return dup2(oldfd, newfd);
+#else
+       errno = ENOSYS;
+       return -1;
+#endif
+}
+
 /**************************************************************************
  Wrapper for Admin Logs.
 ****************************************************************************/