From 5f0b2ece161b16321792d9ff2f76bcc33a3b6b42 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Mon, 23 Nov 2009 08:03:35 +0200 Subject: 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. --- notmuch-new.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'notmuch-new.c') diff --git a/notmuch-new.c b/notmuch-new.c index f58a384b..9d206167 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -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; } -- cgit v1.2.3