diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-08-29 14:15:34 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-29 18:19:51 -0700 |
commit | 58536d157b70c5107d3c064bf009dfb9b52919ce (patch) | |
tree | 34c0bb4cfe351849eafe7641a031f8cf4c4fc27d /pp_sys.c | |
parent | efe889ae38a5f2c6e26a31f33186cd13d4946962 (diff) | |
download | perl-58536d157b70c5107d3c064bf009dfb9b52919ce.tar.gz |
&CORE::umask()
This commit allows &CORE::umask to be called through references and
via ampersand syntax. pp_umask is modified to take into account the
nulls pushed on to the stack in pp_coreargs, which happens because
pp_coreargs has no other way to tell umask how many arguments it’s
actually getting. See commit 0163043a for details.
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -749,7 +749,7 @@ PP(pp_umask) dTARGET; Mode_t anum; - if (MAXARG < 1) { + if (MAXARG < 1 || (!TOPs && !POPs)) { anum = PerlLIO_umask(022); /* setting it to 022 between the two calls to umask avoids * to have a window where the umask is set to 0 -- meaning @@ -765,7 +765,7 @@ PP(pp_umask) /* Only DIE if trying to restrict permissions on "user" (self). * Otherwise it's harmless and more useful to just return undef * since 'group' and 'other' concepts probably don't exist here. */ - if (MAXARG >= 1 && (POPi & 0700)) + if (MAXARG >= 1 && (TOPs||POPs) && (POPi & 0700)) DIE(aTHX_ "umask not implemented"); XPUSHs(&PL_sv_undef); #endif |