]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: _check_wait_status: use only async-thread-safe function
authorDaiki Ueno <ueno@gnu.org>
Thu, 13 May 2021 06:40:59 +0000 (08:40 +0200)
committerDaiki Ueno <ueno@gnu.org>
Thu, 13 May 2021 07:23:37 +0000 (09:23 +0200)
As this function shall be called in a signal handler, it shouldn't use
'exit' as it's not async-thread-safe.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
tests/utils.h

index bc8d0c6d3e12c459f9082db96340c2058d9c4d00..3d8dcb7770ae5212e40254a776f22b653c7f5ce8 100644 (file)
@@ -30,6 +30,7 @@
 #include <signal.h>
 #include <string.h>
 #include <stdarg.h>
+#include <unistd.h>
 #include <gnutls/gnutls.h>
 #include <gnutls/pkcs11.h>
 
@@ -160,7 +161,7 @@ inline static void _check_wait_status(int status, unsigned sigonly)
                } else {
                        if (!sigonly) {
                                if (WEXITSTATUS(status) == 77)
-                                       exit(77);
+                                       _exit(77);
                                fail("Child died with status %d\n",
                                     WEXITSTATUS(status));
                        }