diff mbox series

[5/6] pctrl: parent_dead_handler: use _exit instead of exit

Message ID 20220530060304.1296389-6-dominique.martinet@atmark-techno.com
State Accepted
Headers show
Series Fix gcc warnings or -fanalyzer warnings | expand

Commit Message

Dominique MARTINET May 30, 2022, 6:03 a.m. UTC
exit is not thread-safe and should not be used in a signal handler
(could deadlock in e.g. glibc malloc/free if the signal comes during one)

Reported-by: gcc -fanalyzer
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
---
 core/pctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/core/pctl.c b/core/pctl.c
index 8f49de74ca06..a66c7d6793bc 100644
--- a/core/pctl.c
+++ b/core/pctl.c
@@ -63,7 +63,7 @@  static pthread_cond_t threads_towait_cond = PTHREAD_COND_INITIALIZER;
 #if defined(__linux__)
 static void parent_dead_handler(int __attribute__ ((__unused__)) dummy)
 {
-	exit(1);
+	_exit(1);
 }
 #endif