aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-04-22 21:47:25 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-04-22 21:47:25 -0400
commit75328e32045d1275c03f1f37058ee0a3b775c632 (patch)
tree786ecef4dad2079fd29a0deb4ba4fc42c216e0d3 /src/codegen.cpp
parent25dff91fa099489858428a7071b8c76acf1f943d (diff)
downloadzig-75328e32045d1275c03f1f37058ee0a3b775c632.tar.gz
zig-75328e32045d1275c03f1f37058ee0a3b775c632.zip
exit(1) instead of abort() for file not found
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 4581c3e2b3..2d8c385f44 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -6638,12 +6638,14 @@ static void gen_root_source(CodeGen *g) {
Buf *abs_full_path = buf_alloc();
int err;
if ((err = os_path_real(rel_full_path, abs_full_path))) {
- zig_panic("unable to open '%s': %s", buf_ptr(rel_full_path), err_str(err));
+ fprintf(stderr, "unable to open '%s': %s", buf_ptr(rel_full_path), err_str(err));
+ exit(1);
}
Buf *source_code = buf_alloc();
if ((err = os_fetch_file_path(rel_full_path, source_code, true))) {
- zig_panic("unable to open '%s': %s", buf_ptr(rel_full_path), err_str(err));
+ fprintf(stderr, "unable to open '%s': %s", buf_ptr(rel_full_path), err_str(err));
+ exit(1);
}
g->root_import = add_source_file(g, g->root_package, abs_full_path, source_code);