os2: Resolve temp allocator collisions
This commit is contained in:
1 parent
4a709086a4
commit
b9db1dd3e0
34 files changed
+319
-314
No files matched your search
@@ -47,8 +47,8 @@ _fstat_internal :: proc(fd: linux.Fd, allocator: runtime.Allocator) -> (fi: File
|
||||
|
||||
// NOTE: _stat and _lstat are using _fstat to avoid a race condition when populating fullpath
|
||||
_stat :: proc(name: string, allocator: runtime.Allocator) -> (fi: File_Info, err: Error) {
|
||||
TEMP_ALLOCATOR_GUARD()
|
||||
name_cstr := temp_cstring(name) or_return
|
||||
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({ allocator }))
|
||||
name_cstr := clone_to_cstring(name, temp_allocator) or_return
|
||||
|
||||
fd, errno := linux.open(name_cstr, {})
|
||||
if errno != .NONE {
|
||||
@@ -59,8 +59,8 @@ _stat :: proc(name: string, allocator: runtime.Allocator) -> (fi: File_Info, err
|
||||
}
|
||||
|
||||
_lstat :: proc(name: string, allocator: runtime.Allocator) -> (fi: File_Info, err: Error) {
|
||||
TEMP_ALLOCATOR_GUARD()
|
||||
name_cstr := temp_cstring(name) or_return
|
||||
temp_allocator := get_temp_allocator(TEMP_ALLOCATOR_GUARD({ allocator }))
|
||||
name_cstr := clone_to_cstring(name, temp_allocator) or_return
|
||||
|
||||
fd, errno := linux.open(name_cstr, {.PATH, .NOFOLLOW})
|
||||
if errno != .NONE {
|
||||
|
||||
Reference in new issue
Block a user