mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
Avoid compiler warnings due to ignored write return values
Glibc (at least) provides the warn_unused_result attribute on write, (if optimizing and _FORTIFY_SOURCE is defined). So we explicitly ignore the return value in our signal handler, where we couldn't do anything anyway. Compile with: make CFLAGS="-O -D_FORTIFY_SOURCE" before this commit to see the warning.
This commit is contained in:
parent
55559ea409
commit
5f0b2ece16
2 changed files with 6 additions and 2 deletions
|
@ -35,8 +35,10 @@ static volatile sig_atomic_t interrupted;
|
|||
static void
|
||||
handle_sigint (unused (int sig))
|
||||
{
|
||||
ssize_t ignored;
|
||||
static char msg[] = "Stopping... \n";
|
||||
write(2, msg, sizeof(msg)-1);
|
||||
|
||||
ignored = write(2, msg, sizeof(msg)-1);
|
||||
interrupted = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,10 @@ static volatile sig_atomic_t interrupted;
|
|||
static void
|
||||
handle_sigint (unused (int sig))
|
||||
{
|
||||
ssize_t ignored;
|
||||
|
||||
static char msg[] = "Stopping... \n";
|
||||
write(2, msg, sizeof(msg)-1);
|
||||
ignored = write(2, msg, sizeof(msg)-1);
|
||||
interrupted = 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue