Re: [PATCH v2 06/10] cli: refactor insert

Subject: Re: [PATCH v2 06/10] cli: refactor insert

Date: Sat, 05 Jul 2014 10:18:05 -0300

To: Peter Wang, notmuch@notmuchmail.org

Cc:

From: David Bremner


Peter Wang <novalazy@gmail.com> 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

Thread: