[8/8] sysdeps/pthread/eintr.c: fix warn unused result
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
dj/TryBot-32bit |
success
|
Build for i686
|
Commit Message
Fix unused result warnings, detected when _FORTIFY_SOURCE is enabled in
glibc.
---
sysdeps/pthread/eintr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
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
@@ -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)) {};
_exit (1);
}
- write (STDOUT_FILENO, ".", 1);
+ if (write (STDOUT_FILENO, ".", 1)) {};
}