summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-07-01 11:18:27 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-07-01 11:18:27 +0000
commit38af81ff258ecdcd67c7b6fdf4b602a68c7fd75f (patch)
tree93051fd0303af2981eccd1eb05703e8293a5cbe0 /pp_sys.c
parent43c32782ed6d18ddfca58337454582a388bfa6f8 (diff)
downloadperl-38af81ff258ecdcd67c7b6fdf4b602a68c7fd75f.tar.gz
Integrate from perlio:
[ 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..)
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 7ee8b9e049..b240b62b20 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -742,6 +742,14 @@ PP(pp_binmode)
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;
}