summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbb/copy_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index ffdb824..7ddb9a2 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -153,7 +153,7 @@ int copy_file(const char *source, const char *dest, int flags)
}
}
- dst_fd = open(dest, O_WRONLY);
+ dst_fd = open(dest, O_WRONLY|O_TRUNC);
if (dst_fd == -1) {
if (!(flags & FILEUTILS_FORCE)) {
bb_perror_msg("unable to open `%s'", dest);