This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PerlIO_push returns NULL, not -1, on failure.
[perl5.git] / perlio.c
index 3ce31d1..a7a1667 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -1323,7 +1323,7 @@ PerlIOBase_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers,
     PerlIO_funcs * const tab = PerlIO_layer_fetch(aTHX_ layers, n - 1, PerlIO_default_layer(aTHX_ 0));
     if (tab && tab->Open) {
        PerlIO* ret = (*tab->Open)(aTHX_ tab, layers, n - 1, mode, fd, imode, perm, old, narg, args);
-       if (ret && PerlIO_push(aTHX_ ret, self, mode, PerlIOArg) == -1) {
+       if (ret && PerlIO_push(aTHX_ ret, self, mode, PerlIOArg) == NULL) {
            PerlIO_close(ret);
            return NULL;
        }