summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-23 20:59:45 +0100
committerFelix Fietkau <nbd@openwrt.org>2016-01-23 20:59:45 +0100
commitcaa8052ac55218a687593f3dcf30229016e48b0d (patch)
tree6305b0bfbdcfba2f78edf4485a6e5e767b66625e
parentc35d9db9362e095553f2c043b1a2bf195435bc09 (diff)
downloaduclient-caa8052ac55218a687593f3dcf30229016e48b0d.tar.gz
uclient-fetch: truncate output files (unless resuming)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--uclient-fetch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/uclient-fetch.c b/uclient-fetch.c
index ebf49ae..851994f 100644
--- a/uclient-fetch.c
+++ b/uclient-fetch.c
@@ -103,7 +103,7 @@ static int open_output_file(const char *path, uint64_t resume_offset)
if (cur_resume)
flags = O_RDWR;
else
- flags = O_WRONLY;
+ flags = O_WRONLY | O_TRUNC;
if (!cur_resume && !output_file)
flags |= O_EXCL;