aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcov-io.cc
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-05-02 08:44:16 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-05-02 10:50:48 +0200
commit880a9845dc126e10ceb07b846d5a4c5b167b5185 (patch)
treed1b5999bad1fda9a7ca15886e2a42c2486040824 /gcc/gcov-io.cc
parent3a3eda000fdf4f8754c9a2535191091f1db0c2a2 (diff)
downloadgcc-880a9845dc126e10ceb07b846d5a4c5b167b5185.zip
gcc-880a9845dc126e10ceb07b846d5a4c5b167b5185.tar.gz
gcc-880a9845dc126e10ceb07b846d5a4c5b167b5185.tar.bz2
gcov: Fix first time gcov info dump
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.
Diffstat (limited to 'gcc/gcov-io.cc')
-rw-r--r--gcc/gcov-io.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/gcov-io.cc b/gcc/gcov-io.cc
index fdf745e..62032cc 100644
--- a/gcc/gcov-io.cc
+++ b/gcc/gcov-io.cc
@@ -79,11 +79,14 @@ gcov_is_error (void)
}
#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