branch update for HEAD-2003021201
[reactos.git] / lib / crtdll / io / dup.c
index f2a22ce..6711658 100644 (file)
@@ -1,12 +1,18 @@
+/* $Id$ */
 #include <windows.h>
-#include <crtdll/io.h>
+#include <msvcrt/io.h>
+#include <msvcrt/internal/file.h>
 
 // fixme change type of mode argument to mode_t
 
 int __fileno_alloc(HANDLE hFile, int mode);
 int __fileno_getmode(int _fd);
 
-int _dup( int handle )
+int _dup(int handle)
 {
-       return  __fileno_alloc(_get_osfhandle(handle), __fileno_getmode(handle));
+    HANDLE hFile;
+    int fd;
+    hFile = _get_osfhandle(handle);
+       fd = __fileno_alloc(hFile, __fileno_getmode(handle));
+    return fd;
 }