summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>2006-12-12 15:28:25 -0800
committerSteve Peters <steve@fisharerojo.org>2006-12-13 19:53:02 +0000
commit713cef20be507239588df9cdc5f99ce04b7e0b40 (patch)
tree00549fe2cfdf237bcf2e21de1c56a041f532ad4c /util.c
parent4d28fe79573bb61e3777837866812631f24ed631 (diff)
downloadperl-713cef20be507239588df9cdc5f99ce04b7e0b40.tar.gz
Text mode wrongly set on pipe file descriptors
Message-ID: <20061213072825.GA26300@powdermilk.math.berkeley.edu> p4raw-id: //depot/perl@29550
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.c b/util.c
index 8dfe417f5e..c5f69ae291 100644
--- a/util.c
+++ b/util.c
@@ -2356,6 +2356,14 @@ Perl_my_popen(pTHX_ const char *cmd, const char *mode)
PerlProc__exit(1);
}
#endif /* defined OS2 */
+
+#ifdef PERLIO_USING_CRLF
+ /* Since we circumvent IO layers when we manipulate low-level
+ filedescriptors directly, need to manually switch to the
+ default, binary, low-level mode; see PerlIOBuf_open(). */
+ PerlLIO_setmode((*mode == 'r'), O_BINARY);
+#endif
+
if ((tmpgv = gv_fetchpvs("$", GV_ADD|GV_NOTQUAL, SVt_PV))) {
SvREADONLY_off(GvSV(tmpgv));
sv_setiv(GvSV(tmpgv), PerlProc_getpid());