projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b19dee
)
(dup2): Catch dup() failure. Return correct value.
author
Richard Kenner
<kenner@gcc.gnu.org>
Thu, 10 Mar 1994 20:23:01 +0000
(15:23 -0500)
committer
Richard Kenner
<kenner@gcc.gnu.org>
Thu, 10 Mar 1994 20:23:01 +0000
(15:23 -0500)
From-SVN: r6740
gcc/collect2.c
patch
|
blob
|
history
diff --git
a/gcc/collect2.c
b/gcc/collect2.c
index 8256d87e246b66b49df18ca66c75e1b9d9616924..9f097a9ae4bdad6c6320ba06745ef093accea7e9 100644
(file)
--- a/
gcc/collect2.c
+++ b/
gcc/collect2.c
@@
-277,14
+277,14
@@
dup2 (oldfd, newfd)
int fd;
if (oldfd == newfd)
- return
0
;
+ return
oldfd
;
close (newfd);
- while ((fd = dup (oldfd)) != newfd) /* good enough for low fd's */
+ while ((fd = dup (oldfd)) != newfd
&& fd >= 0
) /* good enough for low fd's */
fdtmp[fdx++] = fd;
while (fdx > 0)
close (fdtmp[--fdx]);
- return
0
;
+ return
fd
;
}
#endif