public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2736] gcov: check return code of a fclose
@ 2021-08-04 15:27 Martin Liska
0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-08-04 15:27 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:929f2cf4105ccf12d0684c6d5838f58f0ee5e7c7
commit r12-2736-g929f2cf4105ccf12d0684c6d5838f58f0ee5e7c7
Author: Vincent Lefèvre <vincent-gcc@vinc17.net>
Date: Wed Aug 4 17:25:52 2021 +0200
gcov: check return code of a fclose
gcc/ChangeLog:
PR gcov-profile/101773
* gcov-io.c (gcov_close): Check return code of a fclose.
Diff:
---
gcc/gcov-io.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c
index 4b1e11d4530..7819593234a 100644
--- a/gcc/gcov-io.c
+++ b/gcc/gcov-io.c
@@ -199,7 +199,9 @@ gcov_close (void)
{
if (gcov_var.file)
{
- fclose (gcov_var.file);
+ if (fclose (gcov_var.file))
+ gcov_var.error = 1;
+
gcov_var.file = 0;
}
gcov_var.mode = 0;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-04 15:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 15:27 [gcc r12-2736] gcov: check return code of a fclose Martin Liska
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).