aboutsummaryrefslogtreecommitdiff
path: root/build.c
diff options
context:
space:
mode:
authorGravatar Moon Flower <moon@coffin.ir> 2025-03-14 10:14:17 +0330
committerGravatar Moon Flower <moon@coffin.ir> 2025-03-14 10:14:17 +0330
commita1d54dd8b69c1731e0bd4229a4af0d83b5e330d3 (patch)
tree55ac881136a9bcb5055eb5a3260e7ba6a7f5504c /build.c
parentMoved unnecessary files to local. (diff)
Error checking.
Diffstat (limited to 'build.c')
-rw-r--r--build.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/build.c b/build.c
index e3bdb04..d9bda31 100644
--- a/build.c
+++ b/build.c
@@ -172,11 +172,15 @@ int system(const char *command) {
return status;
}
-int run(const char *command) {
+void run(const char *command) {
staputs("> ");
puts(command);
staputs("\n");
- return system(command);
+ int status = system(command);
+ if (status != 0) {
+ staputs("** Builder encountered error. Exiting with respective code. **\n");
+ exit(status);
+ }
}
__attribute__((diagnose_as_builtin(__builtin_memcpy, 1, 2, 3))) void *
@@ -320,7 +324,7 @@ void run_dep_macro(char *name) {
self[ sizeof(self) - 1 ] = '\0';
run("rm -f moonshine.expander.h");
- system(self);
+ run(self);
}
unsigned char install_ran = 0;