fileno() was failing when passed a NULL. I'm guessing that we don't really need...
authorSteve Peters <steve@fisharerojo.org>
Mon, 23 Feb 2009 19:25:33 +0000 (13:25 -0600)
committerDavid Mitchell <davem@iabyn.com>
Tue, 14 Apr 2009 23:47:25 +0000 (00:47 +0100)
(cherry picked from commit 40596bc538f0e2be42b50d80f46887e76a4a3b33)

perlio.c

index 934caac..3803247 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -3028,7 +3028,9 @@ PerlIOStdio_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags)
        stdio = PerlSIO_fdopen(fd, PerlIO_modestr(o,mode));
     set_this:
        PerlIOSelf(f, PerlIOStdio)->stdio = stdio;
-       PerlIOUnix_refcnt_inc(fileno(stdio));
+        if(stdio) {
+           PerlIOUnix_refcnt_inc(fileno(stdio));
+        }
     }
     return f;
 }