Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 7C161431FBC for ; Sun, 22 Nov 2009 07:11:07 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VZE9TAiIO2GY for ; Sun, 22 Nov 2009 07:11:06 -0800 (PST) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by olra.theworths.org (Postfix) with ESMTP id 6887A431FAE for ; Sun, 22 Nov 2009 07:11:06 -0800 (PST) Received: from djcbsoftware.nl (a88-112-254-208.elisa-laajakaista.fi [88.112.254.208]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by gw03.mail.saunalahti.fi (Postfix) with ESMTP id BAB93216618 for ; Sun, 22 Nov 2009 17:11:03 +0200 (EET) Received: from cthulhu.mindcrime.djcbsoftware.nl (localhost [127.0.0.1]) by djcbsoftware.nl (Postfix) with ESMTP id 3572F456001 for ; Sun, 22 Nov 2009 17:11:03 +0200 (EET) Date: Sun, 22 Nov 2009 17:11:03 +0200 Message-ID: <87d43ay4qg.wl%djcb@djcbsoftware.nl> From: Dirk-Jan C. Binnema To: "notmuch@notmuchmail org" Mail-Reply-To: djcb@djcbsoftware.nl User-Agent: Wanderlust/2.15.6 (Almost Unreal) Emacs/23.1 Mule/6.0 (HANACHIRUSATO) Organization: DJCBSoftware MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Subject: [notmuch] [PATCH] fix compiler warnings X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: djcb@djcbsoftware.nl List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 15:11:07 -0000 (hopefully this is the correct way to send patches...) With these minor changes, notmuch compiles warning-free with gcc 4.4.1 --- notmuch-new.c | 4 +++- notmuch-setup.c | 13 +++++++------ notmuch-tag.c | 4 +++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index 0dd2784..88b48a6 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -36,7 +36,9 @@ static void handle_sigint (unused (int sig)) { static char msg[] = "Stopping... \n"; - write(2, msg, sizeof(msg)-1); + if (write(2, msg, sizeof(msg)-1) < 0) { + /* ignore...*/ + } interrupted = 1; } diff --git a/notmuch-setup.c b/notmuch-setup.c index 482efd2..0d3f186 100644 --- a/notmuch-setup.c +++ b/notmuch-setup.c @@ -99,12 +99,13 @@ notmuch_setup_command (unused (void *ctx), unsigned int i; int is_new; -#define prompt(format, ...) \ - do { \ - printf (format, ##__VA_ARGS__); \ - fflush (stdout); \ - getline (&response, &response_size, stdin); \ - chomp_newline (response); \ +#define prompt(format, ...) \ + do { \ + printf (format, ##__VA_ARGS__); \ + fflush (stdout); \ + if (getline (&response, &response_size, stdin) < 0) \ + break; \ + chomp_newline (response); \ } while (0) config = notmuch_config_open (ctx, NULL, &is_new); diff --git a/notmuch-tag.c b/notmuch-tag.c index e2311f6..5e40f50 100644 --- a/notmuch-tag.c +++ b/notmuch-tag.c @@ -26,7 +26,9 @@ static void handle_sigint (unused (int sig)) { static char msg[] = "Stopping... \n"; - write(2, msg, sizeof(msg)-1); + if (write(2, msg, sizeof(msg)-1) < 0) { + /* ignore... */ + } interrupted = 1; } -- 1.6.3.3