mirror of
https://github.com/apple/swift-system
synced 2026-11-27 05:04:27 +00:00
[Windows] Add a comment to explain the O_RDONLY/O_WRONLY/O_RDWR logic.
The values of these flags on Windows do not overlap, and more particularly, `O_RDONLY` is actually zero on Windows, which means we cannot test for it by AND-ing.
This commit is contained in:
1 parent
abc0a6d26f
commit
082adfe732
1 file changed
+3
@@ -620,6 +620,9 @@ fileprivate struct DecodedOpenFlags {
|
||||
dwCreationDisposition = DWORD(OPEN_EXISTING)
|
||||
}
|
||||
|
||||
// The _O_RDONLY, _O_WRONLY and _O_RDWR flags are non-overlapping
|
||||
// on Windows; in particular, _O_RDONLY is zero, which means we can't
|
||||
// test for it by AND-ing.
|
||||
dwDesiredAccess = 0
|
||||
switch (oflag & (_O_RDONLY|_O_WRONLY|_O_RDWR)) {
|
||||
case _O_RDONLY:
|
||||
|
||||
Reference in new issue
Block a user