authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-08 14:21:42-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-08 14:21:42-04:00
logfc9ff13fb610893ce1226c5c439e831f8b0569ee
treeed34f8fc1e9c143c59f00120c7a3269e049ee793
parentd324b1befa6c7f0fd5d18ffe45a98d104a62d8a0

std: avoid calling close twice in InStream

thanks ofelas for pointing this out

1 files changed, 3 insertions(+), 0 deletions(-)

std/io.zig+3
...@@ -191,6 +191,8 @@ pub struct InStream {...@@ -191,6 +191,8 @@ pub struct InStream {
191 }191 }
192 }192 }
193193
194 /// Upon success, the stream is in an uninitialized state. To continue using it,
195 /// you must use the open() function.
194 pub fn close(is: &InStream) -> %void {196 pub fn close(is: &InStream) -> %void {
195 switch (@compileVar("os")) {197 switch (@compileVar("os")) {
196 linux => {198 linux => {
...@@ -206,6 +208,7 @@ pub struct InStream {...@@ -206,6 +208,7 @@ pub struct InStream {
206 else => error.Unexpected,208 else => error.Unexpected,
207 }209 }
208 }210 }
211 return;
209 }212 }
210 },213 },
211 else => @compileError("unsupported OS"),214 else => @compileError("unsupported OS"),