git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Thomas Rast <trast@student.ethz.ch>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Jeff King <peff@peff.net>,
	Alexander Potashev <aspotashev@gmail.com>
Subject: Re: [PATCH v2 2/3] Convert existing die(..., strerror(errno)) to die_errno()
Date: Sat, 6 Jun 2009 22:31:24 +0200	[thread overview]
Message-ID: <200906062231.24184.j6t@kdbg.org> (raw)
In-Reply-To: <095b4af080c11b4ad3fcfaefc9cdf49d383cb714.1244299302.git.trast@student.ethz.ch>

On Samstag, 6. Juni 2009, Thomas Rast wrote:
> Change calls to die(..., strerror(errno)) to use the new die_errno().
>
> In the process, also make slight style adjustments: at least state
> _something_ about the function that failed (instead of just printing
> the pathname), and put paths in single quotes.

> @@ -428,8 +428,8 @@ static void merge_name(const char *remote, struct
> strbuf *msg)
>
>  		fp = fopen(git_path("FETCH_HEAD"), "r");
>  		if (!fp)
> -			die("could not open %s for reading: %s",
> -				git_path("FETCH_HEAD"), strerror(errno));
> +			die_errno("could not open %s for reading",
> +				  git_path("FETCH_HEAD"));

You said you added quotes, but you didn't do that here and in quite a few more 
other cases.

IMHO, the quotes are not an improvement anyway, but that's really only my 
personal taste.

> --- a/connect.c
> +++ b/connect.c
> @@ -256,7 +256,7 @@ static int git_tcp_connect_sock(char *host, int flags)
>  	freeaddrinfo(ai0);
>
>  	if (sockfd < 0)
> -		die("unable to connect a socket (%s)", strerror(saved_errno));
> +		die_errno("unable to connect a socket");

You cannot convert this: We want strerror(saved_errno), but die_errno would 
print strerror(errno).

> @@ -345,7 +345,7 @@ static int git_tcp_connect_sock(char *host, int flags)
>  	}
>
>  	if (sockfd < 0)
> -		die("unable to connect a socket (%s)", strerror(saved_errno));
> +		die_errno("unable to connect a socket");

Same here.

-- Hannes

  reply	other threads:[~2009-06-06 20:31 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-02 21:34 [PATCH] add strerror(errno) to die() calls where applicable Thomas Rast
2009-06-03  1:55 ` Jeff King
     [not found]   ` <2325a7950906031855t1977448lbb1c8aa671c72f3d@mail.gmail.com>
2009-06-04  1:58     ` Alexander Potashev
2009-06-04 20:32       ` Jeff King
2009-06-04  2:05   ` [PATCH] diesys calls die and also reports strerror(errno) Alexander Potashev
2009-06-04 20:50     ` Jeff King
2009-06-04 21:13       ` Junio C Hamano
2009-06-05  6:25       ` Johannes Sixt
2009-06-05  7:12         ` Junio C Hamano
2009-06-06 22:09           ` Jeff King
2009-06-06 13:09   ` [PATCH] add strerror(errno) to die() calls where applicable Thomas Rast
2009-06-06 14:44     ` [PATCH v2 0/3] Thomas Rast <trast@student.ethz.ch> Thomas Rast
2009-06-08 21:02       ` [PATCH v3 0/3] die_errno() Thomas Rast
2009-06-27 15:58         ` [PATCH v4 0/4] die_errno() Thomas Rast
2009-06-27 15:58           ` [PATCH v4 1/4] Introduce die_errno() that appends strerror(errno) to die() Thomas Rast
2009-06-27 15:58           ` [PATCH v4 2/4] die_errno(): double % in strerror() output just in case Thomas Rast
2009-06-27 15:58           ` [PATCH v4 3/4] Convert existing die(..., strerror(errno)) to die_errno() Thomas Rast
2009-06-27 15:58           ` [PATCH v4 4/4] Use die_errno() instead of die() when checking syscalls Thomas Rast
2009-06-27 18:38           ` [PATCH v4 0/4] die_errno() Junio C Hamano
2009-06-08 21:02       ` [PATCH v3 1/3] Introduce die_errno() that appends strerror(errno) to die() Thomas Rast
2009-06-08 22:07         ` Jeff King
2009-06-09  8:22           ` Thomas Rast
2009-06-09  8:53             ` Jeff King
2009-06-09  9:29               ` Andreas Ericsson
2009-06-08 21:02       ` [PATCH v3 2/3] Convert existing die(..., strerror(errno)) to die_errno() Thomas Rast
2009-06-08 21:02       ` [PATCH v3 3/3] Use die_errno() instead of die() when checking syscalls Thomas Rast
2009-06-06 14:44     ` [PATCH v2 1/3] Introduce die_errno() that appends strerror(errno) to die() Thomas Rast
2009-06-06 20:36       ` Johannes Sixt
2009-06-06 20:56         ` Thomas Rast
2009-06-06 21:17           ` Johannes Sixt
2009-06-06 22:47           ` Jeff King
2009-06-06 22:13       ` Jeff King
2009-06-07 11:12         ` Alexander Potashev
2009-06-07 16:57           ` Junio C Hamano
2009-06-08 12:36             ` Jeff King
2009-06-08 15:35               ` Alexander Potashev
2009-06-08 22:04                 ` Jeff King
2009-06-06 14:44     ` [PATCH v2 2/3] Convert existing die(..., strerror(errno)) to die_errno() Thomas Rast
2009-06-06 20:31       ` Johannes Sixt [this message]
2009-06-06 14:44     ` [PATCH v2 3/3] Use die_errno() instead of die() when checking syscalls Thomas Rast
2009-06-06 21:02       ` Johannes Sixt
2009-06-06 22:27         ` Thomas Rast

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=200906062231.24184.j6t@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=aspotashev@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=trast@student.ethz.ch \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).