mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
sys_shm_open: fchmod the returned descriptor to get correct perms
this doesn't happen by default
This commit is contained in:
@@ -206,5 +206,9 @@ sys_shm_open :: proc(name: string, oflag: Open_Flags, mode: Permission) -> (c.in
|
|||||||
result := syscall_shm_open(cname, cmode, cflags)
|
result := syscall_shm_open(cname, cmode, cflags)
|
||||||
state := result != -1
|
state := result != -1
|
||||||
|
|
||||||
|
if state && cflags != 0 {
|
||||||
|
state = (syscall_fchmod(result, cflags) != -1)
|
||||||
|
}
|
||||||
|
|
||||||
return result * cast(c.int)state, state
|
return result * cast(c.int)state, state
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user