Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/libcrun/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1799,6 +1799,12 @@ mark_or_close_fds_ge_than (libcrun_container_t *container, int n, bool close_now
int fd;
struct dirent *next;

#ifdef ENABLE_GCOV
/* Flush gcov data before closing all fds. Any code coverage after this point will be lost. */
if (close_now)
GCOV_DUMP ();
Comment on lines +1803 to +1805

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The GCOV_DUMP() macro is likely only available in coverage builds. To prevent build failures in non-coverage configurations, this block should be wrapped in a preprocessor conditional, for example #ifdef ENABLE_GCOV or a similar macro used in this project for coverage builds.

#ifdef ENABLE_GCOV
  /* Flush gcov data before closing all fds.  Any code coverage after this point will be lost.  */
  if (close_now)
    GCOV_DUMP ();
#endif

#endif

ret = syscall_close_range (n, UINT_MAX, close_now ? 0 : CLOSE_RANGE_CLOEXEC);
if (ret == 0)
{
Expand Down