From: David Bremner Date: Sat, 5 Jul 2014 13:18:05 +0000 (+2100) Subject: Re: [PATCH v2 06/10] cli: refactor insert X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1cea9924b2dec1d6fd1ff6dea33e4bb55124827e;p=notmuch-archives.git Re: [PATCH v2 06/10] cli: refactor insert --- diff --git a/43/275088d224f826747f7e236bcc0518cc155a53 b/43/275088d224f826747f7e236bcc0518cc155a53 new file mode 100644 index 000000000..d2da0c1ed --- /dev/null +++ b/43/275088d224f826747f7e236bcc0518cc155a53 @@ -0,0 +1,73 @@ +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 B1F0F431FB6 + for ; Sat, 5 Jul 2014 06:19:57 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +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 pYTWlS60RAPq for ; + Sat, 5 Jul 2014 06:19:53 -0700 (PDT) +Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net + [87.98.215.224]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id DCC20431FAF + for ; Sat, 5 Jul 2014 06:19:52 -0700 (PDT) +Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim + 4.72) (envelope-from ) + id 1X3PrE-0005vm-TV; Sat, 05 Jul 2014 13:18:24 +0000 +Received: (nullmailer pid 25817 invoked by uid 1000); Sat, 05 Jul 2014 + 13:18:05 -0000 +From: David Bremner +To: Peter Wang , notmuch@notmuchmail.org +Subject: Re: [PATCH v2 06/10] cli: refactor insert +In-Reply-To: <1397653165-15620-7-git-send-email-novalazy@gmail.com> +References: <1397653165-15620-1-git-send-email-novalazy@gmail.com> + <1397653165-15620-7-git-send-email-novalazy@gmail.com> +User-Agent: Notmuch/0.18.1+22~gbf82697 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Sat, 05 Jul 2014 10:18:05 -0300 +Message-ID: <87simgq702.fsf@maritornes.cs.unb.ca> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Sat, 05 Jul 2014 13:19:57 -0000 + +Peter Wang writes: + +> - cleanup_path = tmppath; +> - +> - if (! copy_stdin (fdin, fdout)) +> - goto FAIL; +> + if (! copy_stdin (fdin, fdout)) { +> + close (fdout); +> + unlink (tmppath); +> + return FALSE; +> + } + +I'm not completely convinced by replacement of the "goto FAIL" with the +multiple returns. I'd lean to towards being consistent with the notmuch +codebase unless the FAIL block is really horrendous + +Is there a good reason to use TRUE and FALSE for return values rather +than EXIT_SUCCESS and EXIT_FAILURE? It seems like the latter would be +overall slightly simpler in notmuch_insert_command. + +d