osaf/libs/core/common/daemon.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
By calling exit() instead of _Exit() registered exit functions are called. This enabled for example flushing of gcov data. diff --git a/osaf/libs/core/common/daemon.c b/osaf/libs/core/common/daemon.c --- a/osaf/libs/core/common/daemon.c +++ b/osaf/libs/core/common/daemon.c @@ -355,13 +355,16 @@ static void sigterm_handler(int sig) } /** - * Exit process with a standard syslog message - * To be called after the service has cleaned up per service specific things + * Exit calling process with exit(0) using a standard syslog message. + * This function should be called from the main thread of a server process in + * a "safe" context for calling exit(). Any service specific thing should be + * cleaned up before calling this function. By calling exit(), registered exit + * functions are called before the process is terminated. */ void daemon_exit(void) { syslog(LOG_NOTICE, "exiting on signal %d", SIGTERM); - _Exit(EXIT_SUCCESS); + exit(0); } /** ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel