diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-05-08 02:53:24 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2017-05-08 02:53:24 +0200 |
commit | 6eacbbe17ea7a7f523240400821a911589486d25 (patch) | |
tree | fcc55903038a9e33ac4407e5451312116c4a60cc | |
parent | a3330e0a8ad470c8206410a67600cc0a62887c32 (diff) | |
download | blogc-6eacbbe17ea7a7f523240400821a911589486d25.tar.gz blogc-6eacbbe17ea7a7f523240400821a911589486d25.tar.bz2 blogc-6eacbbe17ea7a7f523240400821a911589486d25.zip |
make: copy: truncate dest file if exists
-rw-r--r-- | src/blogc-make/exec-native.c | 2 |
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)); |