]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Python/dup2.c
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Python / dup2.c
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Python/dup2.c b/AppPkg/Applications/Python/Python-2.7.2/Python/dup2.c
deleted file mode 100644 (file)
index 818af54..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*\r
- * Public domain dup2() lookalike\r
- * by Curtis Jackson @ AT&T Technologies, Burlington, NC\r
- * electronic address:  burl!rcj\r
- *\r
- * dup2 performs the following functions:\r
- *\r
- * Check to make sure that fd1 is a valid open file descriptor.\r
- * Check to see if fd2 is already open; if so, close it.\r
- * Duplicate fd1 onto fd2; checking to make sure fd2 is a valid fd.\r
- * Return fd2 if all went well; return BADEXIT otherwise.\r
- */\r
-\r
-#include <fcntl.h>\r
-#include <unistd.h>\r
-\r
-#define BADEXIT -1\r
-\r
-int\r
-dup2(int fd1, int fd2)\r
-{\r
-       if (fd1 != fd2) {\r
-               if (fcntl(fd1, F_GETFL) < 0)\r
-                       return BADEXIT;\r
-               if (fcntl(fd2, F_GETFL) >= 0)\r
-                       close(fd2);\r
-               if (fcntl(fd1, F_DUPFD, fd2) < 0)\r
-                       return BADEXIT;\r
-       }\r
-       return fd2;\r
-}\r