[notmuch] [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails.

Jameson Graef Rollins jrollins at finestructure.net
Sun Nov 22 13:58:35 PST 2009


This fixes a small bug in notmuch_setup_command such that it returned
OK and output the setup message footer even if the config file write
step failed.
---
 notmuch-setup.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/notmuch-setup.c b/notmuch-setup.c
index 482efd2..68788e1 100644
--- a/notmuch-setup.c
+++ b/notmuch-setup.c
@@ -155,10 +155,11 @@ notmuch_setup_command (unused (void *ctx),
 	notmuch_config_set_database_path (config, absolute_path);
     }
 
-    notmuch_config_save (config);
-
-    if (is_new)
-	welcome_message_post_setup ();
-
-    return 0;
+    if (! notmuch_config_save (config)) {
+	if (is_new)
+	  welcome_message_post_setup ();
+	return 0;
+    } else {
+	return 1;
+    }
 }
-- 
1.6.5



More information about the notmuch mailing list