PerlIO_push returns NULL, not -1, on failure.
authorCraig A. Berry <craigberry@mac.com>
Fri, 21 Jan 2011 19:08:05 +0000 (13:08 -0600)
committerCraig A. Berry <craigberry@mac.com>
Fri, 21 Jan 2011 19:08:05 +0000 (13:08 -0600)
Follow-up to 81fe74fb3f93457df8e864c91546ac6b860657fc.

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;
        }