summaryrefslogtreecommitdiff
path: root/ext/standard/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/file.c')
-rw-r--r--ext/standard/file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index bc5ee3d2c1..f43225e961 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1464,6 +1464,10 @@ PHP_FUNCTION(umask)
oldumask = umask(077);
+ if (BG(umask) != -1) {
+ BG(umask) = oldumask;
+ }
+
if (arg_count == 0) {
umask(oldumask);
} else {
@@ -1474,8 +1478,6 @@ PHP_FUNCTION(umask)
umask(Z_LVAL_PP(arg1));
}
- /* XXX we should maybe reset the umask after each request! */
-
RETURN_LONG(oldumask);
}