summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-08-29 14:15:34 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-08-29 18:19:51 -0700
commit58536d157b70c5107d3c064bf009dfb9b52919ce (patch)
tree34c0bb4cfe351849eafe7641a031f8cf4c4fc27d /pp_sys.c
parentefe889ae38a5f2c6e26a31f33186cd13d4946962 (diff)
downloadperl-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 2da7fbd578..ccc4325889 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -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