git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
New API: get-umask, returns the current umask (RHBZ#582891).
[libguestfs.git]
/
daemon
/
umask.c
diff --git
a/daemon/umask.c
b/daemon/umask.c
index
22d2cc9
..
a9ddeab
100644
(file)
--- 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;
+}