diff options
author | Jo-Philipp Wich <jo@mein.io> | 2023-11-01 14:09:35 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2023-11-01 14:14:15 +0100 |
commit | a69b5c8c416342a7855da19dfdc264a078f30848 (patch) | |
tree | 6b0957ca797a4ae418e6c5291cd22b887882a51c | |
parent | ea046bdae231988bda123995676e60db0aaa8745 (diff) |
vm: fix unused result warning
When building against glibc with enabled source fortification, gcc reports
the following issue:
.../vm.c: In function ‘uc_vm_signal_raise’:
.../vm.c:3161:9: error: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
3161 | write(vm->signal.sigpipe[1], &signum, sizeof(signum));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Since we cannot do any meaningful handling of a potential write error in
the affected signal handler context, simply solve this issue by wrapping
the `write()` call into an empty `if ()` statement.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | vm.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3158,7 +3158,7 @@ uc_vm_signal_raise(uc_vm_t *vm, int signo) vm->signal.raised[signo / 64] |= (1ull << (signo % 64)); - write(vm->signal.sigpipe[1], &signum, sizeof(signum)); + if (write(vm->signal.sigpipe[1], &signum, sizeof(signum)) == -1) {} } int |