projects
/
project
/
uclient.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
235ce84
)
uclient-fetch: allow overwriting files if -O was used
author
Felix Fietkau
<nbd@openwrt.org>
Thu, 21 Jan 2016 15:58:26 +0000
(16:58 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Thu, 21 Jan 2016 15:58:26 +0000
(16:58 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
uclient-fetch.c
patch
|
blob
|
history
diff --git
a/uclient-fetch.c
b/uclient-fetch.c
index 010117d4909fd79df81ac4f943f348e983e040ca..223d3641683b5519f7db5305597db05148543494 100644
(file)
--- 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;