diff options
author | Dirk-Jan C. Binnema <djcb.bulk@gmail.com> | 2009-11-23 08:03:35 +0200 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-12-01 07:50:35 -0800 |
commit | 5f0b2ece161b16321792d9ff2f76bcc33a3b6b42 (patch) | |
tree | 68a47643c827ff65865f309dd33c2c1878b1ebde /notmuch-tag.c | |
parent | 55559ea409ad8df367f13752430244b7087dcd23 (diff) |
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.
Diffstat (limited to 'notmuch-tag.c')
-rw-r--r-- | notmuch-tag.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/notmuch-tag.c b/notmuch-tag.c index 07cb8c5f..00588a11 100644 --- a/notmuch-tag.c +++ b/notmuch-tag.c @@ -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; } |