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 74095431FC4 for ; Sun, 22 Nov 2009 13:58:32 -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 S95sWqoc0-k8 for ; Sun, 22 Nov 2009 13:58:31 -0800 (PST) X-Greylist: delayed 105285 seconds by postgrey-1.32 at olra; Sun, 22 Nov 2009 13:58:31 PST Received: from tarap.cc.columbia.edu (tarap.cc.columbia.edu [128.59.29.7]) by olra.theworths.org (Postfix) with ESMTP id A88B2431FAE for ; Sun, 22 Nov 2009 13:58:31 -0800 (PST) Received: from servo.finestructure.net (cpe-72-227-128-66.nyc.res.rr.com [72.227.128.66]) (user=jgr2110 author=jrollins@finestructure.net mech=PLAIN bits=0) by tarap.cc.columbia.edu (8.14.3/8.14.3) with ESMTP id nAMLwUTn009370 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 22 Nov 2009 16:58:31 -0500 (EST) Received: from jrollins by servo.finestructure.net with local (Exim 4.69) (envelope-from ) id 1NCKSE-0000Gt-IZ; Sun, 22 Nov 2009 16:58:46 -0500 From: Jameson Graef Rollins To: notmuch@notmuchmail.org Date: Sun, 22 Nov 2009 16:58:35 -0500 Message-Id: <1258927116-528-2-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.6.5 In-Reply-To: <1258927116-528-1-git-send-email-jrollins@finestructure.net> References: <1258927116-528-1-git-send-email-jrollins@finestructure.net> X-No-Spam-Score: Local X-Scanned-By: MIMEDefang 2.65 on 128.59.29.7 Subject: [notmuch] [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails. X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list 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 21:58:32 -0000 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