Skip to content

Commit

Permalink
GCOV
Browse files Browse the repository at this point in the history
- Fix GCC 11+ change from `__gcov_flush()` to `__gcov_dump()`
  • Loading branch information
jelu committed May 15, 2023
1 parent 7e9aeb7 commit 976589d
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 976589d

Please sign in to comment.