mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-19 14:25:10 -04:00
get .MODE and .TYPE right
This commit is contained in:
@@ -98,7 +98,7 @@ _read_directory_iterator_init :: proc(it: ^Read_Directory_Iterator, f: ^File) {
|
||||
}
|
||||
|
||||
stat: linux.Statx
|
||||
errno := linux.statx(linux.Fd(fd(f)), "", {.EMPTY_PATH}, {.MODE}, &stat)
|
||||
errno := linux.statx(linux.Fd(fd(f)), "", {.EMPTY_PATH}, {.TYPE}, &stat)
|
||||
if errno != .NONE {
|
||||
read_directory_iterator_set_error(it, name(f), _get_platform_error(errno))
|
||||
return
|
||||
|
||||
@@ -280,7 +280,7 @@ _write_at :: proc(f: ^File_Impl, p: []byte, offset: i64) -> (nt: i64, err: Error
|
||||
@(no_sanitize_memory)
|
||||
_file_size :: proc(f: ^File_Impl) -> (n: i64, err: Error) {
|
||||
s: linux.Statx = ---
|
||||
errno := linux.statx(f.fd, "", {.EMPTY_PATH}, {.SIZE, .MODE}, &s)
|
||||
errno := linux.statx(f.fd, "", {.EMPTY_PATH}, {.SIZE, .TYPE}, &s)
|
||||
if errno != .NONE {
|
||||
return 0, _get_platform_error(errno)
|
||||
}
|
||||
|
||||
@@ -439,7 +439,7 @@ _process_start :: proc(desc: Process_Desc) -> (process: Process, err: Error) {
|
||||
|
||||
exe_path = strings.to_cstring(&exe_builder) or_return
|
||||
stat: linux.Statx
|
||||
if linux.statx(linux.AT_FDCWD, exe_path, {}, {.MODE}, &stat) == .NONE && .IFREG in stat.mode && .IXUSR in stat.mode {
|
||||
if linux.statx(linux.AT_FDCWD, exe_path, {}, {.TYPE, .MODE}, &stat) == .NONE && .IFREG in stat.mode && .IXUSR in stat.mode {
|
||||
found = true
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user