public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-2736] gcov: check return code of a fclose Date: Wed, 4 Aug 2021 15:27:44 +0000 (GMT) [thread overview] Message-ID: <20210804152744.7AB893945C26@sourceware.org> (raw) 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;
reply other threads:[~2021-08-04 15:27 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210804152744.7AB893945C26@sourceware.org \ --to=marxin@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).