summaryrefslogtreecommitdiffstats
path: root/daemon/umask.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/umask.c')
-rw-r--r--daemon/umask.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/daemon/umask.c b/daemon/umask.c
index 22d2cc93..a9ddeab0 100644
--- a/daemon/umask.c
+++ b/daemon/umask.c
@@ -44,3 +44,20 @@ do_umask (int mask)
return r;
}
+
+int
+do_get_umask (void)
+{
+ int r;
+
+ r = umask (022);
+ if (r == -1) {
+ reply_with_perror ("umask");
+ return -1;
+ }
+
+ /* Restore the umask, since the call above corrupted it. */
+ umask (r);
+
+ return r;
+}