summaryrefslogtreecommitdiffstats
path: root/tests/newscn.c
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2017-04-11 16:31:27 +0200
committerUlf Hermann <[email protected]>2017-05-08 09:47:06 +0000
commit14192f5767b3388d9f6a1cdc8cadfb047b7a1f6a (patch)
treedfe8fa844fb85a22f7d9d4e09f3a1d8e2e8103bc /tests/newscn.c
parent9f59b055f56ccebaa3d272d153c74fb889958a8a (diff)
Close files before renaming or unlinking them
On windows we cannot rename or unlink open files. Change-Id: Ieae8712266a3e65217580d4936219767c5f26f21 Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'tests/newscn.c')
-rw-r--r--tests/newscn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/newscn.c b/tests/newscn.c
index 466f2f68..de8951df 100644
--- a/tests/newscn.c
+++ b/tests/newscn.c
@@ -46,7 +46,6 @@ main (void)
fprintf (stderr, "Failed to open fdput file: %s\n", name);
exit (1);
}
- unlink (name);
elf = elf_begin (fd, ELF_C_WRITE, NULL);
if (elf == NULL)
@@ -62,5 +61,7 @@ main (void)
elf_end (elf);
close (fd);
+ unlink (name);
+
return 0;
}