From fc9ff13fb610893ce1226c5c439e831f8b0569ee Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 8 Sep 2016 14:21:42 -0400 Subject: [PATCH] std: avoid calling close twice in InStream thanks ofelas for pointing this out --- std/io.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/std/io.zig b/std/io.zig index d68a259878801b1520c703121a6e0515221f7d09..a0c868f81643064e24b3d80723886baa4393484f 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"), -- 2.54.0