Subject: Re: [PATCH] entry.c: Use strerror() to print error info when possible

From: "Luiz Fernando N. Capitulino" <[email-masked]>
Date: Sun, 15 Apr 2007 20:57:09 -0300

Em Mon, 16 Apr 2007 01:00:20 +0200
Alex Riesen <[email-masked]> escreveu:

| Luiz Fernando N. Capitulino, Sun, Apr 15, 2007 23:56:19 +0200:
| > 
| > Signed-off-by: Luiz Fernando N. Capitulino <[email-masked]>
| > ---
| >  entry.c |   11 ++++++-----
| >  1 files changed, 6 insertions(+), 5 deletions(-)
| > 
| > diff --git a/entry.c b/entry.c
| > index d72f811..c36c09d 100644
| > --- a/entry.c
| > +++ b/entry.c
| > @@ -19,7 +19,8 @@ static void create_directories(const char *path, struct checkout *state)
| >  				if (!stat(buf, &st) && S_ISDIR(st.st_mode))
| >  					continue; /* ok */
| >  			}
| > -			die("cannot create directory at %s", buf);
| > +			die("cannot create directory at %s (%s)", buf,
| > +			    strerror(errno));
| 
| This errno is not very useful, as it may come from the stat above, and
| you provided no way to figure out what was the syscall (the mkdir or
| the stat) which failed. Also, the errnos of unlink or mkdir just above
| the stat are just lost.
| 
| It is not worse than before, but not very much better either, and
| probably confusing. I suggest you just leave this one as it is.

 Will do, thanks for reviewing Alex.