From: Frédéric Bérat Date: Fri, 28 Apr 2023 12:21:33 +0000 (+0200) Subject: sysdeps/pthread/eintr.c: fix warn unused result X-Git-Tag: upstream/2.39~745 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7aec73c40691b7dfa48d22941ff72238aebe82eb;p=platform%2Fupstream%2Fglibc.git sysdeps/pthread/eintr.c: fix warn unused result Fix unused result warnings, detected when _FORTIFY_SOURCE is enabled in glibc. Reviewed-by: Siddhesh Poyarekar --- diff --git a/sysdeps/pthread/eintr.c b/sysdeps/pthread/eintr.c index 000649d..1619139 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 */}; }