diff options
| author | Graydon Hoare <[email protected]> | 2011-03-20 19:42:51 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-03-20 19:43:41 -0700 |
| commit | 460d89156f1fcfc9613a578a7c2218308236d212 (patch) | |
| tree | d08dab7aaed8acc2fa69156fc29a68215ce47edd /src/lib | |
| parent | Fix multi-stage deps, add rules for stage1 and stage2 outputs. (diff) | |
| download | rust-460d89156f1fcfc9613a578a7c2218308236d212.tar.xz rust-460d89156f1fcfc9613a578a7c2218308236d212.zip | |
Add slightly nicer failure message to io.rs when it can't open a file.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/io.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/io.rs b/src/lib/io.rs index a84fbbe9..58cb1f80 100644 --- a/src/lib/io.rs +++ b/src/lib/io.rs @@ -108,7 +108,10 @@ fn stdin() -> reader { fn file_reader(str path) -> reader { auto f = os.libc.fopen(_str.buf(path), _str.buf("r")); - check (f as uint != 0u); + if (f as uint == 0u) { + log "error opening " + path; + fail; + } ret FILE_reader(f, true); } |