| ... | ... | @@ -822,7 +822,7 @@ pub const Dir = struct { |
| 822 | 822 | return self.openDirTraverseW(&sub_path_w); |
| 823 | 823 | } else { |
| 824 | 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 | 832 | const sub_path_w = try os.windows.cStrToPrefixedFileW(sub_path_c); |
| 833 | 833 | return self.openDirListW(&sub_path_w); |
| 834 | 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 | 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 | 841 | error.FileTooBig => unreachable, // can't happen for directories |
| 842 | 842 | error.IsDir => unreachable, // we're providing O_DIRECTORY |
| 843 | 843 | error.NoSpaceLeft => unreachable, // not providing O_CREAT |