Re: [PATCH] Re: [ PATCH ] Cygwin groups.t (PLEASE CHECK)
Nicholas Clark [Wed, 26 Dec 2001 19:19:47 +0000 (19:19 +0000)]
Message-ID: <20011226191946.K48842@plum.flirble.org>

Use report_evil_fh().

p4raw-id: //depot/perl@13892

doio.c

diff --git a/doio.c b/doio.c
index 4e977b7..32427eb 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -951,21 +951,7 @@ Perl_do_eof(pTHX_ GV *gv)
     if (!io)
        return TRUE;
     else if (ckWARN(WARN_IO) && (IoTYPE(io) == IoTYPE_WRONLY))
-    {
-       /* integrate to report_evil_fh()? */
-        char *name = NULL;
-       if (isGV(gv)) {
-           SV* sv = sv_newmortal();
-           gv_efullname4(sv, gv, Nullch, FALSE);
-           name = SvPV_nolen(sv);
-       }
-       if (name && *name)
-           Perl_warner(aTHX_ WARN_IO,
-                       "Filehandle %s opened only for output", name);
-       else
-           Perl_warner(aTHX_ WARN_IO,
-                       "Filehandle opened only for output");
-    }
+       report_evil_fh(gv, io, OP_phoney_OUTPUT_ONLY);
 
     while (IoIFP(io)) {