Andrew Geissler | eef6386 | 2021-01-29 15:58:13 -0600 | [diff] [blame] | 1 | From 78912c0ac5e090095a2f2bd6226e02cce949e72e Mon Sep 17 00:00:00 2001 |
| 2 | From: He Zhe <zhe.he@windriver.com> |
| 3 | Date: Fri, 22 Jan 2021 10:03:38 +0000 |
| 4 | Subject: [PATCH] lat_fifo: Fix cleanup sequence |
| 5 | |
| 6 | Files should be unlinked after all users exit. |
| 7 | |
| 8 | Signed-off-by: He Zhe <zhe.he@windriver.com> |
| 9 | --- |
| 10 | src/lat_fifo.c | 12 ++++++------ |
| 11 | 1 file changed, 6 insertions(+), 6 deletions(-) |
| 12 | |
| 13 | diff --git a/src/lat_fifo.c b/src/lat_fifo.c |
| 14 | index c625161..85bb9d1 100644 |
| 15 | --- a/src/lat_fifo.c |
| 16 | +++ b/src/lat_fifo.c |
| 17 | @@ -120,16 +120,16 @@ cleanup(iter_t iterations, void * cookie) |
| 18 | |
| 19 | if (iterations) return; |
| 20 | |
| 21 | - unlink(state->filename1); |
| 22 | - unlink(state->filename2); |
| 23 | - close(state->wr); |
| 24 | - close(state->rd); |
| 25 | - |
| 26 | if (state->pid > 0) { |
| 27 | - kill(state->pid, 15); |
| 28 | + kill(state->pid, SIGKILL); |
| 29 | waitpid(state->pid, NULL, 0); |
| 30 | state->pid = 0; |
| 31 | } |
| 32 | + |
| 33 | + unlink(state->filename1); |
| 34 | + unlink(state->filename2); |
| 35 | + close(state->wr); |
| 36 | + close(state->rd); |
| 37 | } |
| 38 | |
| 39 | void |
| 40 | -- |
| 41 | 2.29.2 |
| 42 | |