git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
LCLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Date
Apr 15, 2007, 23:54 UTC
Message-ID
<20070415205433.3b475f60@gnut>
In-Reply-To
<7v7isd2qq0.fsf@assigned-by-dhcp.cox.net>

Em Sun, 15 Apr 2007 15:54:47 -0700 Junio C Hamano <junkio@cox.net> escreveu:

| "Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br>
| writes:
| 
| > Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
| > ---
| >  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));
| >  		}
| >  	}
| >  	free(buf);
| 
| This hunk is wrong; stat() you see in the context could have
| been what failed the last before this die().
 You right, will try to read the code more carefully before
patching.
| I do not think other places you patched do not share the issue.
 Other places seems ok, I'll review and re-send along with other
patches I'm working on.
 Thanks a lot for the feedback.
Previous: Junio C HamanoNext: Alex Riesen
Message 3 of 5 in “entry.c: Use strerror() to print error info when possible”
  1. entry.c: Use strerror() to print error info when possibleLuiz Fernando N. Capitulino, Apr 15, 2007
  2. Junio C HamanoApr 15, 2007
  3. Luiz Fernando N. CapitulinoApr 15, 2007
  4. Alex RiesenApr 15, 2007
  5. Luiz Fernando N. CapitulinoApr 15, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.