diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-10-23 04:27:10 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-10-29 06:20:51 -0700 |
| commit | 1b0dcd400717b3ced323a66c525371ed1b928cbf (patch) | |
| tree | 428728429595b29307c0982c38625c070be67746 | |
| parent | f17c6bba579e2c8929bf37a5980b37ebe9ccc517 (diff) | |
| download | zig-1b0dcd400717b3ced323a66c525371ed1b928cbf.tar.gz zig-1b0dcd400717b3ced323a66c525371ed1b928cbf.zip | |
std.Io.Threaded: fix setting of O_NONBLOCK flag
| -rw-r--r-- | lib/std/Io/Threaded.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index c1365e0f44..8b880a176f 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -1651,7 +1651,7 @@ fn dirCreateFilePosix( else => |err| return posix.unexpectedErrno(err), } }; - fl_flags &= ~@as(usize, 1 << @bitOffsetOf(posix.O, "NONBLOCK")); + fl_flags |= @as(usize, 1 << @bitOffsetOf(posix.O, "NONBLOCK")); while (true) { try t.checkCancel(); switch (posix.errno(posix.system.fcntl(fd, posix.F.SETFL, fl_flags))) { @@ -1897,7 +1897,7 @@ fn dirOpenFilePosix( else => |err| return posix.unexpectedErrno(err), } }; - fl_flags &= ~@as(usize, 1 << @bitOffsetOf(posix.O, "NONBLOCK")); + fl_flags |= @as(usize, 1 << @bitOffsetOf(posix.O, "NONBLOCK")); while (true) { try t.checkCancel(); switch (posix.errno(posix.system.fcntl(fd, posix.F.SETFL, fl_flags))) { |
