public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] sysdeps/pthread/eintr.c: fix warn unused result
Date: Thu, 25 May 2023 01:54:13 +0000 (GMT)	[thread overview]
Message-ID: <20230525015413.574113858436@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7aec73c40691b7dfa48d22941ff72238aebe82eb

commit 7aec73c40691b7dfa48d22941ff72238aebe82eb
Author: Frédéric Bérat <fberat@redhat.com>
Date:   Fri Apr 28 14:21:33 2023 +0200

    sysdeps/pthread/eintr.c: fix warn unused result
    
    Fix unused result warnings, detected when _FORTIFY_SOURCE is enabled in
    glibc.
    
    Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

Diff:
---
 sysdeps/pthread/eintr.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sysdeps/pthread/eintr.c b/sysdeps/pthread/eintr.c
index 000649d24e..16191395a7 100644
--- a/sysdeps/pthread/eintr.c
+++ b/sysdeps/pthread/eintr.c
@@ -31,10 +31,12 @@ eintr_handler (int sig)
 {
   if (sig != the_sig)
     {
-      write (STDOUT_FILENO, "eintr_handler: signal number wrong\n", 35);
+      /* empty if statement avoids warn unused result */
+      if (write (STDOUT_FILENO,
+		 "eintr_handler: signal number wrong\n", 35) < 35) {};
       _exit (1);
     }
-  write (STDOUT_FILENO, ".", 1);
+  if (write (STDOUT_FILENO, ".", 1)) {/* Avoid warn unused result */};
 }

                 reply	other threads:[~2023-05-25  1:54 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=20230525015413.574113858436@sourceware.org \
    --to=siddhesh@sourceware.org \
    --cc=glibc-cvs@sourceware.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: link
Be 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).