Fail in new_stdio_reader when libc.fopen fails.

This commit is contained in:
Graydon Hoare 2011-01-10 18:16:57 -08:00
parent e96414a6f0
commit b000bfeedc

View file

@ -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);
}