Change 33491 by [EMAIL PROTECTED] on 2008/03/12 11:46:17 Correct logic error in PerlIOStdio_close() - 0 is an acceptable value from dup(), so it can't also be the "don't do anything later" value.
Affected files ... ... //depot/perl/perlio.c#382 edit Differences ... ==== //depot/perl/perlio.c#382 (text) ==== Index: perl/perlio.c --- perl/perlio.c#381~33370~ 2008-02-25 09:42:38.000000000 -0800 +++ perl/perlio.c 2008-03-12 04:46:17.000000000 -0700 @@ -3130,7 +3130,7 @@ int invalidate = 0; IV result = 0; int saveerr = 0; - int dupfd = 0; + int dupfd = -1; #ifdef SOCKS5_VERSION_NAME /* Socks lib overrides close() but stdio isn't linked to that library (though we are) - so we must call close() @@ -3171,7 +3171,7 @@ /* in SOCKS' case, let close() determine return value */ result = close(fd); #endif - if (dupfd) { + if (dupfd >= 0) { PerlLIO_dup2(dupfd,fd); PerlLIO_close(dupfd); } End of Patch.