This patch fixes an issue introduced by commit
ef9a53feae5701953da9161afef2aea0329ec8b2:
gcc --coverage main.c && ./a.out
libgcov profiling error:a-main.gcda:Error writing
gcc/ChangeLog:
* gcov-io.cc (gcov_rewrite): Clear the file error status.
}
#if IN_LIBGCOV
-/* Move to beginning of file and initialize for writing. */
+/* Move to beginning of file, initialize for writing, and clear file error
+ status. */
+
GCOV_LINKAGE inline void
gcov_rewrite (void)
{
gcov_var.mode = -1;
+ gcov_var.error = GCOV_FILE_NO_ERROR;
fseek (gcov_var.file, 0L, SEEK_SET);
}
#endif