From: Alexey Tourbin <at@altlinux.ru>
Date: Tue, 28 Dec 2004 14:25:42 +0000 (+0300)
Subject: Integrate a patch from Gentoo for uclibc support.
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef8eacb8aa7b0a6c0b0ace784386130fa2680a56;p=p5sagit%2Fp5-mst-13.2.git

Integrate a patch from Gentoo for uclibc support.
See :
Subject: Re: Static linking notes --- perl5.8.6 and uClibc
Message-ID: <20041228112542.GB21037@solemn.turbinal.org>

p4raw-id: //depot/perl@23732
---

diff --git a/perlio.c b/perlio.c
index 466bd17..e03ed45 100644
--- a/perlio.c
+++ b/perlio.c
@@ -2830,7 +2830,11 @@ PerlIOStdio_invalidate_fileno(pTHX_ FILE *f)
     /* XXX this could use PerlIO_canset_fileno() and
      * PerlIO_set_fileno() support from Configure
      */
-#  if defined(__GLIBC__)
+#  if defined(__UCLIBC__)
+    /* uClibc must come before glibc because it defines __GLIBC__ as well. */
+    f->__filedes = -1;
+    return 1;
+#  elif defined(__GLIBC__)
     /* There may be a better way for GLIBC:
     	- libio.h defines a flag to not close() on cleanup
      */