aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-make/exec-native.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2019-03-28 19:42:13 +0100
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2019-03-28 19:42:13 +0100
commit09139645e866b745c9f8797659f12c90af867015 (patch)
tree846b257841555e5bc91cad1c47eafddc406e19d3 /src/blogc-make/exec-native.c
parent35702f4cfcc5ffc21d8dcbf0a9d176118fec2927 (diff)
downloadblogc-09139645e866b745c9f8797659f12c90af867015.tar.gz
blogc-09139645e866b745c9f8797659f12c90af867015.tar.bz2
blogc-09139645e866b745c9f8797659f12c90af867015.zip
make: exit 1 on error
Diffstat (limited to 'src/blogc-make/exec-native.c')
-rw-r--r--src/blogc-make/exec-native.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/blogc-make/exec-native.c b/src/blogc-make/exec-native.c
index cc734f3..a172193 100644
--- a/src/blogc-make/exec-native.c
+++ b/src/blogc-make/exec-native.c
@@ -55,7 +55,7 @@ bm_exec_native_cp(bm_filectx_t *source, bm_filectx_t *dest, bool verbose)
if (fd_from < 0) {
fprintf(stderr, "blogc-make: error: failed to open source file to copy "
" (%s): %s\n", source->path, strerror(errno));
- return 3;
+ return 1;
}
int fd_to = open(dest->path, O_WRONLY | O_CREAT | O_TRUNC, 0666);
@@ -63,7 +63,7 @@ bm_exec_native_cp(bm_filectx_t *source, bm_filectx_t *dest, bool verbose)
fprintf(stderr, "blogc-make: error: failed to open destination file to "
"copy (%s): %s\n", dest->path, strerror(errno));
close(fd_from);
- return 3;
+ return 1;
}
ssize_t nread;
@@ -77,7 +77,7 @@ bm_exec_native_cp(bm_filectx_t *source, bm_filectx_t *dest, bool verbose)
"destination file (%s): %s\n", dest->path, strerror(errno));
close(fd_from);
close(fd_to);
- return 3;
+ return 1;
}
nread -= nwritten;
out_ptr += nwritten;
@@ -136,7 +136,7 @@ bm_exec_native_rm(const char *output_dir, bm_filectx_t *dest, bool verbose)
if (0 != unlink(dest->path)) {
fprintf(stderr, "blogc-make: error: failed to remove file (%s): %s\n",
dest->path, strerror(errno));
- return 3;
+ return 1;
}
int rv = 0;
@@ -153,7 +153,7 @@ bm_exec_native_rm(const char *output_dir, bm_filectx_t *dest, bool verbose)
if (err != NULL) {
fprintf(stderr, "blogc-make: error: %s\n", err->msg);
bc_error_free(err);
- rv = 3;
+ rv = 1;
break;
}
if (!empty) {
@@ -167,7 +167,7 @@ bm_exec_native_rm(const char *output_dir, bm_filectx_t *dest, bool verbose)
fprintf(stderr,
"blogc-make: error: failed to remove directory(%s): %s\n",
dir, strerror(errno));
- rv = 3;
+ rv = 1;
break;
}
if (0 == strcmp(dir, output_dir)) {