diff options
| author | Graydon Hoare <[email protected]> | 2011-01-10 18:16:57 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-01-10 18:16:57 -0800 |
| commit | b000bfeedcbfc9859d1599183cdd270938fe526c (patch) | |
| tree | 36fd1d42d344ab9c9ffa4afded9bbf6c07337787 /src/lib | |
| parent | Further corrections to the Makefile rules covering failing tests. (diff) | |
| download | rust-b000bfeedcbfc9859d1599183cdd270938fe526c.tar.xz rust-b000bfeedcbfc9859d1599183cdd270938fe526c.zip | |
Fail in new_stdio_reader when libc.fopen fails.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/_io.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/_io.rs b/src/lib/_io.rs index bbf5550d..f285f6c8 100644 --- a/src/lib/_io.rs +++ b/src/lib/_io.rs @@ -20,8 +20,9 @@ fn new_stdio_reader(str path) -> stdio_reader { os.libc.fclose(f); } } - ret stdio_FILE_reader(os.libc.fopen(_str.buf(path), - _str.buf("r"))); + auto FILE = os.libc.fopen(_str.buf(path), _str.buf("r")); + check (FILE as uint != 0u); + ret stdio_FILE_reader(FILE); } |