summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-01-17 16:24:20 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-01-18 13:56:07 +0000
commit1ef70f118a9638f78c8135e361b422322c8e30f2 (patch)
treee2c3f7a6c1aeb4469d85a1412616427e1450c1ed
parent1f1bb33622a517fb674953fedd247fc0d0198f19 (diff)
strip: unlink() debug file before rename()ing into it
On windows you cannot rename into an existing file. Change-Id: I07ad0b42260e98579b00d828c96bd47db006840c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/strip.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/strip.c b/src/strip.c
index 15a43ff7..aad1035b 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -2448,6 +2448,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
/* Create the real output file. First rename, then change the
mode. */
close (debug_fd);
+ unlink (debug_fname);
int rename_result = rename (tmp_debug_fname, debug_fname);
debug_fd = open (debug_fname, O_RDONLY | O_BINARY);
if (rename_result != 0 || debug_fd == -1