aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-setup.c
diff options
context:
space:
mode:
authorGravatar Jameson Graef Rollins <jrollins@finestructure.net>2009-11-22 16:58:35 -0500
committerGravatar Carl Worth <cworth@cworth.org>2009-11-25 19:24:27 -0800
commit34c840a23e1db4c6cf4a836b441d027fc17e9706 (patch)
tree6aca75432c525537eeb85eef50de165878d69353 /notmuch-setup.c
parent5c5727ab52c1d2ef3e8ef255949c078faaefc876 (diff)
modify notmuch_setup_command to return 1 if config file write fails.
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.
Diffstat (limited to 'notmuch-setup.c')
-rw-r--r--notmuch-setup.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/notmuch-setup.c b/notmuch-setup.c
index d06fbf80..5ec176d3 100644
--- a/notmuch-setup.c
+++ b/notmuch-setup.c
@@ -156,10 +156,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;
+ }
}