aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-03-20 19:42:51 -0700
committerGraydon Hoare <[email protected]>2011-03-20 19:43:41 -0700
commit460d89156f1fcfc9613a578a7c2218308236d212 (patch)
treed08dab7aaed8acc2fa69156fc29a68215ce47edd /src
parentFix multi-stage deps, add rules for stage1 and stage2 outputs. (diff)
downloadrust-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')
-rw-r--r--src/lib/io.rs5
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);
}