Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143013033
D25929.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D25929.diff
View Options
Index: head/lib/libc/gen/setmode.c
===================================================================
--- head/lib/libc/gen/setmode.c
+++ head/lib/libc/gen/setmode.c
@@ -70,7 +70,7 @@
#define CMD2_OBITS 0x08
#define CMD2_UBITS 0x10
-static mode_t getumask(void);
+static mode_t get_current_umask(void);
static BITCMD *addcmd(BITCMD *, mode_t, mode_t, mode_t, mode_t);
static void compress_mode(BITCMD *);
#ifdef SETMODE_DEBUG
@@ -186,7 +186,7 @@
* Get a copy of the mask for the permissions that are mask relative.
* Flip the bits, we want what's not set.
*/
- mask = ~getumask();
+ mask = ~get_current_umask();
setlen = SET_LEN + 2;
@@ -343,13 +343,14 @@
}
static mode_t
-getumask(void)
+get_current_umask(void)
{
sigset_t sigset, sigoset;
size_t len;
mode_t mask;
u_short smask;
+#ifdef KERN_PROC_UMASK
/*
* First try requesting the umask without temporarily modifying it.
* Note that this does not work if the sysctl
@@ -359,7 +360,7 @@
if (sysctl((int[4]){ CTL_KERN, KERN_PROC, KERN_PROC_UMASK, 0 },
4, &smask, &len, NULL, 0) == 0)
return (smask);
-
+#endif
/*
* Since it's possible that the caller is opening files inside a signal
* handler, protect them as best we can.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 26, 6:42 AM (4 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28008544
Default Alt Text
D25929.diff (1 KB)
Attached To
Mode
D25929: Allow building setmode.c on Linux/macOS
Attached
Detach File
Event Timeline
Log In to Comment