diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-08-12 18:51:27 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-08-12 18:51:27 +0200 |
| commit | a4ac3cc6e8de8902e7b0bc6bdddfd3fb54ffeb7a (patch) | |
| tree | 35e36589032374b793e6b76bfc3e8d9db6302423 /core/os/os_linux.odin | |
| parent | b71e0c2e3673b5b712847cf67e9a196a4d2d136b (diff) | |
fix `os.read_dir` closing the given file descriptor
Diffstat (limited to 'core/os/os_linux.odin')
| -rw-r--r-- | core/os/os_linux.odin | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/os/os_linux.odin b/core/os/os_linux.odin index 29219dc3b..78da32a57 100644 --- a/core/os/os_linux.odin +++ b/core/os/os_linux.odin @@ -886,6 +886,12 @@ _readlink :: proc(path: string) -> (string, Error) { } } +@(private, require_results) +_dup :: proc(fd: Handle) -> (Handle, Error) { + dup, err := linux.dup(linux.Fd(fd)) + return Handle(dup), err +} + @(require_results) absolute_path_from_handle :: proc(fd: Handle) -> (string, Error) { buf : [256]byte |