os2: fix wiping results with temp allocator guard

This commit is contained in:
Laytan Laats
2024-08-14 01:44:37 +02:00
parent 7474db6a34
commit bd808f9ec6
15 changed files with 25 additions and 38 deletions
+2 -4
View File
@@ -48,8 +48,7 @@ _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) {
assert(!is_temp(allocator))
TEMP_ALLOCATOR_GUARD()
TEMP_ALLOCATOR_GUARD(ignore=is_temp(allocator))
name_cstr := temp_cstring(name) or_return
fd, errno := linux.open(name_cstr, {})
@@ -61,8 +60,7 @@ _stat :: proc(name: string, allocator: runtime.Allocator) -> (fi: File_Info, err
}
_lstat :: proc(name: string, allocator: runtime.Allocator) -> (fi: File_Info, err: Error) {
assert(!is_temp(allocator))
TEMP_ALLOCATOR_GUARD()
TEMP_ALLOCATOR_GUARD(ignore=is_temp(allocator))
name_cstr := temp_cstring(name) or_return
fd, errno := linux.open(name_cstr, {.PATH, .NOFOLLOW})