mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 16:43:07 +00:00
std.Io.Threaded: fix setting of O_NONBLOCK flag
This commit is contained in:
parent
f17c6bba57
commit
1b0dcd4007
@ -1651,7 +1651,7 @@ fn dirCreateFilePosix(
|
|||||||
else => |err| return posix.unexpectedErrno(err),
|
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) {
|
while (true) {
|
||||||
try t.checkCancel();
|
try t.checkCancel();
|
||||||
switch (posix.errno(posix.system.fcntl(fd, posix.F.SETFL, fl_flags))) {
|
switch (posix.errno(posix.system.fcntl(fd, posix.F.SETFL, fl_flags))) {
|
||||||
@ -1897,7 +1897,7 @@ fn dirOpenFilePosix(
|
|||||||
else => |err| return posix.unexpectedErrno(err),
|
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) {
|
while (true) {
|
||||||
try t.checkCancel();
|
try t.checkCancel();
|
||||||
switch (posix.errno(posix.system.fcntl(fd, posix.F.SETFL, fl_flags))) {
|
switch (posix.errno(posix.system.fcntl(fd, posix.F.SETFL, fl_flags))) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user