mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
Merge alpha100 branch back to main trunk
This commit is contained in:
parent
2979b01ff8
commit
b6775db241
176 changed files with 5302 additions and 3668 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue