diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-12 11:25:19 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-12 11:25:19 +0000 |
commit | 56c3d3d7f7f1b45cf341cc25dbc0fbde54dceab1 (patch) | |
tree | 56071fd7ace66ccc5463039a41d389727ef709db /perlio.c | |
parent | 579f9913bd0b54ec2474ba1d4322c32a64a3ee05 (diff) | |
download | perl-56c3d3d7f7f1b45cf341cc25dbc0fbde54dceab1.tar.gz |
Slightly amended version of the proposed patch for
"[perl #22390] export PERLIO=bytes segfaults";
the amendment is to set errno.
TODO: we really should not get here if the layer
stack is corrupt or non-sensical (like "bytes").
p4raw-id: //depot/perl@19747
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -3421,8 +3421,10 @@ PerlIOBuf_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, * mode++; */ } - f = (*tab->Open) (aTHX_ tab, layers, n - 1, mode, fd, imode, perm, - f, narg, args); + f = tab && tab->Open ? + (*tab->Open) (aTHX_ tab, layers, n - 1, mode, fd, imode, perm, + f, narg, args) + : Nullfp; if (f) { if (PerlIO_push(aTHX_ f, self, mode, PerlIOArg) == 0) { /* @@ -3451,6 +3453,8 @@ PerlIOBuf_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, #endif } } + else + SETERRNO(EINVAL, SS_IVCHAN); } return f; } |