From: Richard Stallman Date: Tue, 28 Jul 1992 02:18:03 +0000 (+0000) Subject: entered into RCS X-Git-Tag: misc/cutover-egcs-0~12234 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=f28e8a6876e35548d6a43850f0c7be8727770e7f;p=gcc.git entered into RCS From-SVN: r1697 --- diff --git a/gcc/collect2.c b/gcc/collect2.c index 5915cf079bbd..532f1824b08b 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;