aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2017-05-08 02:53:24 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2017-05-08 02:53:24 +0200
commit6eacbbe17ea7a7f523240400821a911589486d25 (patch)
treefcc55903038a9e33ac4407e5451312116c4a60cc /src
parenta3330e0a8ad470c8206410a67600cc0a62887c32 (diff)
downloadblogc-6eacbbe17ea7a7f523240400821a911589486d25.tar.gz
blogc-6eacbbe17ea7a7f523240400821a911589486d25.tar.bz2
blogc-6eacbbe17ea7a7f523240400821a911589486d25.zip
make: copy: truncate dest file if exists
Diffstat (limited to 'src')
-rw-r--r--src/blogc-make/exec-native.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/blogc-make/exec-native.c b/src/blogc-make/exec-native.c
index 08484cd..a02cd26 100644
--- a/src/blogc-make/exec-native.c
+++ b/src/blogc-make/exec-native.c
@@ -58,7 +58,7 @@ bm_exec_native_cp(bm_filectx_t *source, bm_filectx_t *dest, bool verbose)
return 3;
}
- int fd_to = open(dest->path, O_WRONLY | O_CREAT, 0666);
+ int fd_to = open(dest->path, O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (fd_to < 0) {
fprintf(stderr, "blogc-make: error: failed to open destination file to "
"copy (%s): %s\n", dest->path, strerror(errno));