aboutsummaryrefslogtreecommitdiff
path: root/std/io.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-09-08 14:21:42 -0400
committerAndrew Kelley <superjoe30@gmail.com>2016-09-08 14:21:42 -0400
commitfc9ff13fb610893ce1226c5c439e831f8b0569ee (patch)
treeed34f8fc1e9c143c59f00120c7a3269e049ee793 /std/io.zig
parentd324b1befa6c7f0fd5d18ffe45a98d104a62d8a0 (diff)
downloadzig-fc9ff13fb610893ce1226c5c439e831f8b0569ee.tar.gz
zig-fc9ff13fb610893ce1226c5c439e831f8b0569ee.zip
std: avoid calling close twice in InStream
thanks ofelas for pointing this out
Diffstat (limited to 'std/io.zig')
-rw-r--r--std/io.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/std/io.zig b/std/io.zig
index d68a259878..a0c868f816 100644
--- a/std/io.zig
+++ b/std/io.zig
@@ -191,6 +191,8 @@ pub struct InStream {
}
}
+ /// Upon success, the stream is in an uninitialized state. To continue using it,
+ /// you must use the open() function.
pub fn close(is: &InStream) -> %void {
switch (@compileVar("os")) {
linux => {
@@ -206,6 +208,7 @@ pub struct InStream {
else => error.Unexpected,
}
}
+ return;
}
},
else => @compileError("unsupported OS"),