This will be needed for the pull-style API. * strace.c (terminate): New function. (main): Use it. --- strace.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/strace.c b/strace.c index 55c6fe76..2657bcf7 100644 --- a/strace.c +++ b/strace.c @@ -2593,18 +2593,9 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si) extern void __gcov_flush(); #endif -int -main(int argc, char *argv[]) +static void +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) @@ -2639,6 +2630,21 @@ main(int argc, char *argv[]) Exit with 128 + signo then. */ exit_code += 128; } + exit(exit_code); +} + +int +main(int argc, char *argv[]) +{ + init(argc, argv); + + exit_code = !nprocs; + + int status; + siginfo_t si; + while (dispatch_event(next_event(&status, &si), &status, &si)) + ; - return exit_code; + terminate(); + return 0; /* stub */ } -- 2.11.0 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Strace-devel mailing list Strace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/strace-devel