[PATCH 8/8] sysdeps/pthread/eintr.c: fix warn unused result
Siddhesh Poyarekar
siddhesh@gotplt.org
Tue Apr 18 12:54:46 GMT 2023
On 2023-04-18 08:11, Frédéric Bérat via Libc-alpha wrote:
> Fix unused result warnings, detected when _FORTIFY_SOURCE is enabled in
> glibc.
> ---
> sysdeps/pthread/eintr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sysdeps/pthread/eintr.c b/sysdeps/pthread/eintr.c
> index 000649d24e..8441df0c77 100644
> --- a/sysdeps/pthread/eintr.c
> +++ b/sysdeps/pthread/eintr.c
> @@ -31,10 +31,10 @@ eintr_handler (int sig)
> {
> if (sig != the_sig)
> {
> - write (STDOUT_FILENO, "eintr_handler: signal number wrong\n", 35);
> + if (write (STDOUT_FILENO, "eintr_handler: signal number wrong\n", 35)) {};
Perhaps add a little comment here saying that it avoids the __wur?
Also, make the check < 35 so that it's semantically correct.
> _exit (1);
> }
> - write (STDOUT_FILENO, ".", 1);
> + if (write (STDOUT_FILENO, ".", 1)) {};
> }
Likewise.
>
>
Thanks,
Sid
More information about the Libc-alpha
mailing list