From b9808a8c3a8922ed8df4e6fe45848ac2e52f13be Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 21 Jan 2016 16:58:26 +0100 Subject: [PATCH] uclient-fetch: allow overwriting files if -O was used Signed-off-by: Felix Fietkau --- uclient-fetch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uclient-fetch.c b/uclient-fetch.c index 010117d..223d364 100644 --- a/uclient-fetch.c +++ b/uclient-fetch.c @@ -103,7 +103,10 @@ static int open_output_file(const char *path, uint64_t resume_offset) if (cur_resume) flags = O_RDWR; else - flags = O_WRONLY | O_EXCL; + flags = O_WRONLY; + + if (!cur_resume && !output_file) + flags |= O_EXCL; flags |= O_CREAT; -- 2.25.1