Skip to content

Commit

Permalink
Merge pull request #287 from jelu/gcov
Browse files Browse the repository at this point in the history
GCOV
  • Loading branch information
jelu authored May 15, 2023
2 parents 7e9aeb7 + 976589d commit 24a2846
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
#if HAVE_PTHREAD
#include <pthread.h>
#endif
#if GCOV_FLUSH
#include <gcov.h>
#endif

char* progname = NULL;
char* pid_file_name = NULL;
Expand Down Expand Up @@ -117,7 +120,11 @@ void daemonize(void)
}
if (pid > 0) {
#ifdef GCOV_FLUSH
#if __GNUC__ >= 11
__gcov_dump();
#else
__gcov_flush();
#endif
#endif
_exit(0);
}
Expand Down Expand Up @@ -620,7 +627,11 @@ int main(int argc, char* argv[])

dump_reports();
#ifdef GCOV_FLUSH
#if __GNUC__ >= 11
__gcov_dump();
#else
__gcov_flush();
#endif
#endif
_exit(0);
}
Expand Down

0 comments on commit 24a2846

Please sign in to comment.