summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-08-30 06:49:31 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-30 06:49:31 +0000
commit6f0313ac0022286607467f5c596289255e627e18 (patch)
tree0fc7a9823864a8387be41fd090009e8e95f19736 /perlio.c
parentf26e2faaba4305b481d576a23dabd2e2b58b75aa (diff)
downloadperl-6f0313ac0022286607467f5c596289255e627e18.tar.gz
Something went wrong in change #20929;
linux 2.4.18-bf2.4 didn't like it: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2003-08/msg01992.html and similar failure pattern also seen in Solaris 8. p4raw-link: @20929 on //depot/perl: 1403d6bf1ee303dd613942fa2f6df0519a053ba6 p4raw-id: //depot/perl@20950
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/perlio.c b/perlio.c
index 7ee1eda229..a508b645fe 100644
--- a/perlio.c
+++ b/perlio.c
@@ -2609,7 +2609,7 @@ PerlIOStdio_mode(const char *mode, char *tmode)
while (*mode) {
*tmode++ = *mode++;
}
-#if defined(PERLIO_USING_CRLF) || defined(__CYGWIN__)
+#ifdef PERLIO_USING_CRLF
*tmode++ = 'b';
#endif
*tmode = '\0';
@@ -2710,28 +2710,25 @@ PerlIOStdio_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers,
fd = PerlLIO_open3(path, imode, perm);
}
else {
- /* Append the 'b' - more correct for CRLF platforms
- * and Cygwin and should be harmless (since it's a
- * no-op) elsewhere. */
- mode = PerlIOStdio_mode(mode, tmode);
- {
- FILE *stdio = PerlSIO_fopen(path, mode);
- if (stdio) {
- PerlIOStdio *s;
- if (!f) {
- f = PerlIO_allocate(aTHX);
- }
- if ((f = PerlIO_push(aTHX_ f, self,
- mode, PerlIOArg))) {
- s = PerlIOSelf(f, PerlIOStdio);
- s->stdio = stdio;
- PerlIOUnix_refcnt_inc(fileno(s->stdio));
- }
- return f;
- }
- }
+ FILE *stdio = PerlSIO_fopen(path, mode);
+ if (stdio) {
+ PerlIOStdio *s;
+ if (!f) {
+ f = PerlIO_allocate(aTHX);
+ }
+ if ((f = PerlIO_push(aTHX_ f, self,
+ (mode = PerlIOStdio_mode(mode, tmode)),
+ PerlIOArg))) {
+ s = PerlIOSelf(f, PerlIOStdio);
+ s->stdio = stdio;
+ PerlIOUnix_refcnt_inc(fileno(s->stdio));
+ }
+ return f;
+ }
+ else {
+ return NULL;
+ }
}
- return NULL;
}
if (fd >= 0) {
FILE *stdio = NULL;