[ 19909]
binmode() should affect IoOFP() as well as IoIFP() if it is
distinct (e.g. sockets).
p4raw-link: @19909 on //depot/perlio:
5a828df094714ebe5d444cf1aea96c870ca9e452
p4raw-id: //depot/perl@19910
p4raw-integrated: from //depot/perlio@19906 'merge in' pp_sys.c
(@19868..)
PUTBACK;
if (PerlIO_binmode(aTHX_ fp,IoTYPE(io),mode_from_discipline(discp),
(discp) ? SvPV_nolen(discp) : Nullch)) {
+ if (IoOFP(io) && IoOFP(io) != IoIFP(io)) {
+ if (!PerlIO_binmode(aTHX_ IoOFP(io),IoTYPE(io),
+ mode_from_discipline(discp),
+ (discp) ? SvPV_nolen(discp) : Nullch)) {
+ SPAGAIN;
+ RETPUSHUNDEF;
+ }
+ }
SPAGAIN;
RETPUSHYES;
}