aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-12-29 11:13:00 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-12-29 11:13:00 -0700
commit717cf00fe0d68dc1213fb645b184afe1cbf52104 (patch)
treebcfdeec3c406aeb2a0427d816d0f3d242354fdce /lib/std/os.zig
parent892b37cdae89fe23d2a19b0b512fc1f7a73dd6ce (diff)
downloadzig-717cf00fe0d68dc1213fb645b184afe1cbf52104.tar.gz
zig-717cf00fe0d68dc1213fb645b184afe1cbf52104.zip
std.ChildProcess: improvements to collectOutputPosix
* read directly into the ArrayList buffers. * respect max_output_bytes * std.ArrayList: - make `allocatedSlice` public. - add `unusedCapacitySlice`. I removed the Windows implementation of this stuff; I am doing a partial merge of LemonBoy's patch with the understanding that a later patch can add the Windows implementation after it is vetted.
Diffstat (limited to 'lib/std/os.zig')
-rw-r--r--lib/std/os.zig3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig
index 88f6292629..66f65b5b5d 100644
--- a/lib/std/os.zig
+++ b/lib/std/os.zig
@@ -5269,8 +5269,7 @@ pub const PollError = error{
pub fn poll(fds: []pollfd, timeout: i32) PollError!usize {
while (true) {
- const fds_count = math.cast(nfds_t, fds.len) catch
- return error.SystemResources;
+ const fds_count = math.cast(nfds_t, fds.len) catch return error.SystemResources;
const rc = system.poll(fds.ptr, fds_count, timeout);
if (builtin.os.tag == .windows) {
if (rc == windows.ws2_32.SOCKET_ERROR) {