aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-07-28 02:18:03 +0000
committerRichard Stallman <rms@gnu.org>1992-07-28 02:18:03 +0000
commitf28e8a6876e35548d6a43850f0c7be8727770e7f (patch)
treeef1d8ad6272ada9a26dba0aa6f4d1eb2e1edd143 /gcc
parent99df2465b701d4b9cbc6c90f4d19f3bb4ac1f62f (diff)
downloadgcc-f28e8a6876e35548d6a43850f0c7be8727770e7f.zip
gcc-f28e8a6876e35548d6a43850f0c7be8727770e7f.tar.gz
gcc-f28e8a6876e35548d6a43850f0c7be8727770e7f.tar.bz2
entered into RCS
From-SVN: r1697
Diffstat (limited to 'gcc')
-rw-r--r--gcc/collect2.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 5915cf0..532f182 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -206,6 +206,25 @@ generic *xmalloc ();
extern char *index ();
extern char *rindex ();
+#ifdef NO_DUP2
+dup2 (oldfd, newfd)
+ int oldfd;
+ int newfd;
+{
+ int fdtmp[256];
+ int fdx = 0;
+ int fd;
+
+ if (oldfd == newfd)
+ return 0;
+ close (newfd);
+ while ((fd = dup (oldfd)) != newfd) /* good enough for low fd's */
+ fdtmp[fdx++] = fd;
+ while (fdx > 0)
+ close (fdtmp[--fdx]);
+}
+#endif
+
char *
my_strerror (e)
int e;