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