summaryrefslogtreecommitdiffstats
path: root/Python/dup2.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-08-01 11:34:53 (GMT)
committerGuido van Rossum <guido@python.org>1994-08-01 11:34:53 (GMT)
commitb6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af (patch)
tree9362939305b2d088b8f19a530c9015d886bc2801 /Python/dup2.c
parent2979b01ff88ac4c5b316d9bf98edbaaaffac8e24 (diff)
downloadcpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.zip
cpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.tar.gz
cpython-b6775db241f5fe5e3dc2ca09fc6c9e6164d4b2af.tar.bz2
Merge alpha100 branch back to main trunk
Diffstat (limited to 'Python/dup2.c')
-rw-r--r--Python/dup2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/dup2.c b/Python/dup2.c
index 85ec5d5..ee1a7ad 100644
--- a/Python/dup2.c
+++ b/Python/dup2.c
@@ -20,12 +20,17 @@ dup2(fd1, fd2)
int fd1, fd2;
{
if (fd1 != fd2) {
+#ifdef MPW
+ close (fd2); /* XXX RJW MPW does not implement F_GETFL but it does have dup */
+ fd2 = dup(fd1);
+#else
if (fcntl(fd1, F_GETFL) < 0)
return BADEXIT;
if (fcntl(fd2, F_GETFL) >= 0)
close(fd2);
if (fcntl(fd1, F_DUPFD, fd2) < 0)
return BADEXIT;
+#endif
}
return fd2;
}