check: use _exit() instead of exit() in fail_unless() so we exit immediately
authorTim-Philipp Müller <tim@centricular.com>
Fri, 2 May 2014 16:02:37 +0000 (17:02 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Wed, 7 May 2014 09:44:34 +0000 (10:44 +0100)
exit() will call atexit handlers, which may try to
clean up things or wait for things to get cleaned up,
which we don't want or need. We just want to stop
and let the parent know about the failure as quickly
as possible in case fork() is used.

Fixes timeouts on assert failures in checks where
an exit handler waits for things to stop, but they
don't stop because they haven't been shut down,
and they haven't been shut down because there's no
simple way to do so on failures.

http://sourceforge.net/p/check/patches/50/

libs/gst/check/libcheck/check.c

index 9aba434..2b7f481 100644 (file)
@@ -248,7 +248,7 @@ _fail_unless (int result, const char *file, int line, const char *expr, ...)
     send_failure_info (buf);
     if (cur_fork_status () == CK_FORK) {
 #ifdef _POSIX_VERSION
-      exit (1);
+      _exit (1);
 #endif /* _POSIX_VERSION */
     }
   }