Commit fc9ff13fb6

Andrew Kelley <superjoe30@gmail.com>
2016-09-08 20:21:42
std: avoid calling close twice in InStream
thanks ofelas for pointing this out
1 parent d324b1b
Changed files (1)
std
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"),