unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] fix compiler warnings
@ 2009-11-22 15:11 Dirk-Jan C. Binnema
  2009-11-23  3:22 ` Carl Worth
  0 siblings, 1 reply; 3+ messages in thread
From: Dirk-Jan C. Binnema @ 2009-11-22 15:11 UTC (permalink / raw)
  To: notmuch@notmuchmail org


(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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-23  4:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-22 15:11 [PATCH] fix compiler warnings Dirk-Jan C. Binnema
2009-11-23  3:22 ` Carl Worth
2009-11-23  4:43   ` Jeffrey Ollie

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).