blob: 42b14cecee6b3c22c6d23cc1e9050f393ecd149e [file] [log] [blame]
Andrew Geisslereef63862021-01-29 15:58:13 -06001From 78912c0ac5e090095a2f2bd6226e02cce949e72e Mon Sep 17 00:00:00 2001
2From: He Zhe <zhe.he@windriver.com>
3Date: Fri, 22 Jan 2021 10:03:38 +0000
4Subject: [PATCH] lat_fifo: Fix cleanup sequence
5
6Files should be unlinked after all users exit.
7
8Signed-off-by: He Zhe <zhe.he@windriver.com>
9---
10 src/lat_fifo.c | 12 ++++++------
11 1 file changed, 6 insertions(+), 6 deletions(-)
12
13diff --git a/src/lat_fifo.c b/src/lat_fifo.c
14index 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--
412.29.2
42