atexit() is POSIX, whereas on_exit() is not.
Specifically, on_exit() does not exist on
OpenBSD (and perhaps other platforms)
git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1134
64e312b2-a51f-0410-8e61-
82d0ca0eb02a
return s;
}
-void exit_handler(int, void*);
-void exit_handler (int ev, void *arg)
+void exit_handler();
+void exit_handler ()
{
// This exit handler should never be executed
while(1)
START_TEST(test_ignore_exit_handlers)
{
- on_exit(exit_handler, NULL);
+ int result = atexit(exit_handler);
+ if(result != 0)
+ {
+ ck_abort_msg("Failed to set an exit handler, test cannot proceed");
+ }
ck_abort();
#define LINENO_ck_ignore_exit_handlers _STR(__LINE__)
}