| ... | @@ -822,7 +822,7 @@ pub const Dir = struct { | ... | @@ -822,7 +822,7 @@ pub const Dir = struct { |
| 822 | return self.openDirTraverseW(&sub_path_w); | 822 | return self.openDirTraverseW(&sub_path_w); |
| 823 | } else { | 823 | } else { |
| 824 | const O_PATH = if (@hasDecl(os, "O_PATH")) os.O_PATH else 0; | 824 | const O_PATH = if (@hasDecl(os, "O_PATH")) os.O_PATH else 0; |
| 825 | return self.openDirFlagsC(sub_path_c, os.O_RDONLY | os.O_DIRECTORY | os.O_CLOEXEC | O_PATH); | 825 | return self.openDirFlagsC(sub_path_c, os.O_RDONLY | os.O_CLOEXEC | O_PATH); |
| 826 | } | 826 | } |
| 827 | } | 827 | } |
| 828 | | 828 | |
| ... | @@ -832,12 +832,12 @@ pub const Dir = struct { | ... | @@ -832,12 +832,12 @@ pub const Dir = struct { |
| 832 | const sub_path_w = try os.windows.cStrToPrefixedFileW(sub_path_c); | 832 | const sub_path_w = try os.windows.cStrToPrefixedFileW(sub_path_c); |
| 833 | return self.openDirListW(&sub_path_w); | 833 | return self.openDirListW(&sub_path_w); |
| 834 | } else { | 834 | } else { |
| 835 | return self.openDirFlagsC(sub_path_c, os.O_RDONLY | os.O_DIRECTORY | os.O_CLOEXEC); | 835 | return self.openDirFlagsC(sub_path_c, os.O_RDONLY | os.O_CLOEXEC); |
| 836 | } | 836 | } |
| 837 | } | 837 | } |
| 838 | | 838 | |
| 839 | fn openDirFlagsC(self: Dir, sub_path_c: [*:0]const u8, flags: u32) OpenError!Dir { | 839 | fn openDirFlagsC(self: Dir, sub_path_c: [*:0]const u8, flags: u32) OpenError!Dir { |
| 840 | const fd = os.openatC(self.fd, sub_path_c, flags, 0) catch |err| switch (err) { | 840 | const fd = os.openatC(self.fd, sub_path_c, flags | os.O_DIRECTORY, 0) catch |err| switch (err) { |
| 841 | error.FileTooBig => unreachable, // can't happen for directories | 841 | error.FileTooBig => unreachable, // can't happen for directories |
| 842 | error.IsDir => unreachable, // we're providing O_DIRECTORY | 842 | error.IsDir => unreachable, // we're providing O_DIRECTORY |
| 843 | error.NoSpaceLeft => unreachable, // not providing O_CREAT | 843 | error.NoSpaceLeft => unreachable, // not providing O_CREAT |