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

Re: [PATCH] sha1_file: make sure correct error is propagated

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 14, 2008, 19:05 UTC
Message-ID
<7vfxlu9lhs.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1226655681.17731.4.camel@maia.lan>
Sam Vilain <sam@vilain.net> writes:
Show 20 quoted lines
> Subject: sha1_file: accept EACCESS as equivalent to EPERM
>
> This was testing for 'Operation not permitted' rather than any kind
> of 'Permission Denied' error; prefer EACCESS.
>     
> Signed-off-by: Sam Vilain <sam@vilain.net>
> --
>   Sorry for the inevitable wrapping/whitespace fail :(
>
> diff --git a/sha1_file.c b/sha1_file.c
> index 7662330..cd422e6 100644
> --- a/sha1_file.c
> +++ b/sha1_file.c
> @@ -2231,7 +2231,7 @@ static int create_tmpfile(char *buffer, size_t
> bufsiz, const char *filename)
>  	memcpy(buffer, filename, dirlen);
>  	strcpy(buffer + dirlen, "tmp_obj_XXXXXX");
>  	fd = mkstemp(buffer);
> -	if (fd < 0 && dirlen && (errno != EPERM)) {
> +	if (fd < 0 && dirlen && (errno != EACCESS)) {
Is this accepting the two as equivalents???
Previous: Sam VilainNext: Francis Galiegue
Message 4 of 9 in “sha1_file: make sure correct error is propagated”
  1. sha1_file: make sure correct error is propagatedSam Vilain, Nov 14, 2008
  2. Francis GaliegueNov 14, 2008
  3. Sam VilainNov 14, 2008
  4. Junio C HamanoNov 14, 2008
  5. Francis GaliegueNov 14, 2008
  6. Andreas EricssonNov 14, 2008
  7. Francis GaliegueNov 14, 2008
  8. Junio C HamanoNov 15, 2008
  9. Sam VilainNov 15, 2008

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.