This will be needed for the pull-style API.
* strace.c (terminate): New function.
(main): Use it.
extern void __gcov_flush();
#endif
-int
-main(int argc, char *argv[])
+static void ATTRIBUTE_NORETURN
+terminate(void)
{
- init(argc, argv);
-
- exit_code = !nprocs;
-
- int status;
- siginfo_t si;
- while (dispatch_event(next_event(&status, &si), &status, &si))
- ;
-
cleanup();
fflush(NULL);
if (shared_log != stderr)
Exit with 128 + signo then. */
exit_code += 128;
}
+ exit(exit_code);
+}
+
+int
+main(int argc, char *argv[])
+{
+ init(argc, argv);
- return exit_code;
+ exit_code = !nprocs;
+
+ int status;
+ siginfo_t si;
+ while (dispatch_event(next_event(&status, &si), &status, &si))
+ ;
+ terminate();
}