From: Steve Peters Date: Mon, 23 Feb 2009 19:25:33 +0000 (-0600) Subject: fileno() was failing when passed a NULL. I'm guessing that we don't really need... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=40596bc538f0e2be42b50d80f46887e76a4a3b33;p=p5sagit%2Fp5-mst-13.2.git fileno() was failing when passed a NULL. I'm guessing that we don't really need to increase the refcount on a NULL fd. --- diff --git a/perlio.c b/perlio.c index b935734..0a086a8 100644 --- a/perlio.c +++ b/perlio.c @@ -3033,7 +3033,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; }