diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ChangeLog | 9 | ||||
| -rw-r--r-- | tests/newfile.c | 7 | ||||
| -rw-r--r-- | tests/newscn.c | 3 | ||||
| -rw-r--r-- | tests/update1.c | 1 | ||||
| -rw-r--r-- | tests/update2.c | 1 | ||||
| -rw-r--r-- | tests/update3.c | 1 | ||||
| -rw-r--r-- | tests/update4.c | 1 |
7 files changed, 20 insertions, 3 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog index 5e29f821..b8de1386 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,14 @@ 2017-05-04 Ulf Hermann <[email protected]> + * newfile.c: Close the file when we're done and unlink it afterwards. + * newscn.c: Likewise. + * update1.c: Likewise. + * update2.c: Likewise. + * update3.c: Likewise. + * update4.c: Likewise. + +2017-05-04 Ulf Hermann <[email protected]> + * asm-tst4.c: Don't assume unix file system conventions. * asm-tst5.c: Likewise. * asm-tst6.c: Likewise. diff --git a/tests/newfile.c b/tests/newfile.c index 5eabdcb7..a2793171 100644 --- a/tests/newfile.c +++ b/tests/newfile.c @@ -63,8 +63,6 @@ main (int argc, char *argv[] __attribute__ ((unused))) printf ("cannot create temporary file: %m\n"); exit (1); } - /* Remove the file when we exit. */ - unlink (fname); elf_version (EV_CURRENT); elf = elf_begin (fd, ELF_C_WRITE, NULL); @@ -166,5 +164,10 @@ main (int argc, char *argv[] __attribute__ ((unused))) (void) elf_end (elf); } + close (fd); + + /* Remove the file when we exit. */ + unlink (fname); + return result; } 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; } diff --git a/tests/update1.c b/tests/update1.c index a5716185..548c6d8a 100644 --- a/tests/update1.c +++ b/tests/update1.c @@ -121,6 +121,7 @@ main (int argc, char *argv[] __attribute__ ((unused))) exit (1); } + close (fd); unlink (fname); return 0; diff --git a/tests/update2.c b/tests/update2.c index 3e228796..1dcff3fc 100644 --- a/tests/update2.c +++ b/tests/update2.c @@ -144,6 +144,7 @@ main (int argc, char *argv[] __attribute__ ((unused))) exit (1); } + close (fd); unlink (fname); return 0; diff --git a/tests/update3.c b/tests/update3.c index d619bed0..9d4f8809 100644 --- a/tests/update3.c +++ b/tests/update3.c @@ -199,6 +199,7 @@ main (int argc, char *argv[] __attribute__ ((unused))) exit (1); } + close (fd); unlink (fname); return 0; diff --git a/tests/update4.c b/tests/update4.c index 8196b8c8..a762e0a0 100644 --- a/tests/update4.c +++ b/tests/update4.c @@ -351,6 +351,7 @@ main (int argc, char *argv[] __attribute__ ((unused))) exit (1); } + close (fd); unlink (fname); return 0; |
