diff options
| author | bkrypt <4868093+bkrypt@users.noreply.github.com> | 2022-04-02 21:55:01 +0200 |
|---|---|---|
| committer | bkrypt <4868093+bkrypt@users.noreply.github.com> | 2022-04-02 21:55:01 +0200 |
| commit | e80bee68673c4e50640d55d8fe71a09e8d4bc2a1 (patch) | |
| tree | f2da801ca81da57493c37e3ff418e1e4d4b9a61d | |
| parent | d10d54710ce34ad9f474392a209fd731a686cfee (diff) | |
Change order of `O_CREATE` & `O_APPEND` checks
| -rw-r--r-- | core/os/file_windows.odin | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/os/file_windows.odin b/core/os/file_windows.odin index 4c8d385f2..ebf2508ca 100644 --- a/core/os/file_windows.odin +++ b/core/os/file_windows.odin @@ -20,13 +20,13 @@ open :: proc(path: string, mode: int = O_RDONLY, perm: int = 0) -> (Handle, Errn case O_RDWR: access = win32.FILE_GENERIC_READ | win32.FILE_GENERIC_WRITE } + if mode&O_CREATE != 0 { + access |= win32.FILE_GENERIC_WRITE + } if mode&O_APPEND != 0 { access &~= win32.FILE_GENERIC_WRITE access |= win32.FILE_APPEND_DATA } - if mode&O_CREATE != 0 { - access |= win32.FILE_GENERIC_WRITE - } share_mode := win32.FILE_SHARE_READ|win32.FILE_SHARE_WRITE sa: ^win32.SECURITY_ATTRIBUTES = nil |