opened only for input.
p4raw-id: //depot/perl@29614
SETERRNO(0,0);
io = GvIO(gv);
- if (!io || !IoIFP(io)) {
+ if (!io || !IoIFP(io) || IoTYPE(io) == IoTYPE_RDONLY) {
retval = -1;
- if (ckWARN(WARN_CLOSED))
- report_evil_fh(gv, io, PL_op->op_type);
+ if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)) {
+ if (io && IoIFP(io))
+ report_evil_fh(gv, io, OP_phoney_INPUT_ONLY);
+ else
+ report_evil_fh(gv, io, PL_op->op_type);
+ }
SETERRNO(EBADF,RMS_IFI);
goto say_undef;
}
Filehandle STDIN opened only for input at - line 3.
########
# pp_sys.c [pp_send]
+use warnings 'io' ;
+syswrite STDIN, "fred";
+no warnings 'io' ;
+syswrite STDIN, "fred";
+EXPECT
+Filehandle STDIN opened only for input at - line 3.
+########
+# pp_sys.c [pp_send]
use warnings 'closed' ;
close STDIN;
syswrite STDIN, "fred", 1;