From: Jarkko Hietaniemi Date: Tue, 11 Apr 2006 23:39:32 +0000 (+0300) Subject: perlio.c: false Coverity finding (it cannot see that two pointers are the same):... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0f0f9e2bc563abd8d7ce0492ab8d3d803fb9e687;p=p5sagit%2Fp5-mst-13.2.git perlio.c: false Coverity finding (it cannot see that two pointers are the same): but help Coverity by removing the temp ptr Message-Id: <200604112039.k3BKdWix334525@kosh.hut.fi> Date: Tue, 11 Apr 2006 23:39:32 +0300 (EEST) p4raw-id: //depot/perl@27770 --- diff --git a/perlio.c b/perlio.c index c5da06a..07c47ce 100644 --- a/perlio.c +++ b/perlio.c @@ -2864,7 +2864,6 @@ PerlIOStdio_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, #endif stdio = PerlSIO_fopen(path, mode); if (stdio) { - PerlIOStdio *s; if (!f) { f = PerlIO_allocate(aTHX); } @@ -2872,9 +2871,10 @@ PerlIOStdio_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, mode = PerlIOStdio_mode(mode, tmode); f = PerlIO_push(aTHX_ f, self, mode, PerlIOArg); if (f) { - s = PerlIOSelf(f, PerlIOStdio); - s->stdio = stdio; - PerlIOUnix_refcnt_inc(fileno(s->stdio)); + PerlIOSelf(f, PerlIOStdio)->stdio = stdio; + PerlIOUnix_refcnt_inc(fileno(stdio)); + } else { + PerlSIO_fclose(stdio); } return f; }