Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
Cc: <git@vger.kernel.org>, <peff@peff.net>
Subject: Re: [PATCH v3 1/4] imap-send: return with error if curl failed
Date: Wed, 23 Aug 2017 13:12:28 -0700	[thread overview]
Message-ID: <xmqqy3qaxcur.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <da29995c-3c56-ac43-9f8f-12bf381711f3@morey-chaisemartin.com> (Nicolas Morey-Chaisemartin's message of "Tue, 22 Aug 2017 17:56:16 +0200")

Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com> writes:

> curl_append_msgs_to_imap always returned 0, whether curl failed or not.
> Return a proper status so git imap-send will exit with an error code
> if womething wrong happened.
>
> Signed-off-by: Nicolas Morey-Chaisemartin <nicolas@morey-chaisemartin.com>
> ---
>  imap-send.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/imap-send.c b/imap-send.c
> index b2d0b849b..09f29ea95 100644
> --- a/imap-send.c
> +++ b/imap-send.c
> @@ -1490,7 +1490,7 @@ static int curl_append_msgs_to_imap(struct imap_server_conf *server,
>  	curl_easy_cleanup(curl);
>  	curl_global_cleanup();
>  
> -	return 0;
> +	return res == CURLE_OK;
>  }
>  #endif

Wait a bit.  Did you mean "res != CURLE_OK"?  If we got an OK, we
want to return 0 as success, because the value we return from here
is returned by cmd_main() as-is to main() and to the outside world,
no?



  parent reply	other threads:[~2017-08-23 20:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 15:55 [PATCH v3 0/4] imap-send: Fix and enable curl by default Nicolas Morey-Chaisemartin
2017-08-22 15:56 ` [PATCH v3 1/4] imap-send: return with error if curl failed Nicolas Morey-Chaisemartin
2017-08-23 20:10   ` Junio C Hamano
2017-08-23 20:12   ` Junio C Hamano [this message]
2017-08-24  6:57     ` Nicolas Morey-Chaisemartin
2017-08-22 15:56 ` [PATCH v3 2/4] imap-send: add wrapper to get server credentials if needed Nicolas Morey-Chaisemartin
2017-08-23 20:13   ` Junio C Hamano
2017-08-24  6:08     ` Nicolas Morey-Chaisemartin
2017-08-24 18:54       ` Junio C Hamano
2017-08-22 15:56 ` [PATCH v3 3/4] imap_send: setup_curl: retreive credentials if not set in config file Nicolas Morey-Chaisemartin
2017-08-22 15:56 ` [PATCH v3 4/4] imap-send: use curl by default Nicolas Morey-Chaisemartin
2017-08-23 20:28   ` Junio C Hamano
2017-08-24  7:24     ` Nicolas Morey-Chaisemartin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqy3qaxcur.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=nicolas@morey-chaisemartin.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox