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

Re: git 565ebbf79f61873042c22a7126d002c104e056f4 broken on OpenBSD

From
Horst von Brand <vonbrand@inf.utfsm.cl>
Date
Oct 26, 2005, 17:22 UTC
Message-ID
<200510261722.j9QHMLGY006576@laptop11.inf.utfsm.cl>
In-Reply-To
<86u0f4fjah.fsf@blue.stonehenge.com>
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
Show 34 quoted lines
> >>>>> "Randal" == Randal L Schwartz <merlyn@stonehenge.com> writes:
> 
> Randal> gcc -o sha1_file.o -c -g -O2 -Wall -I/usr/local/include -L/usr/local/lib -Dstrcasestr=gitstrcasestr -DNO_STRCASESTR=1 -DSHA1_HEADER='<openssl/sha.h>' sha1_file.c
> Randal> sha1_file.c: In function `move_temp_to_file':
> Randal> sha1_file.c:1247: error: `ENOTSUP' undeclared (first use in this function)
> Randal> sha1_file.c:1247: error: (Each undeclared identifier is reported only once
> Randal> sha1_file.c:1247: error: for each function it appears in.)
> Randal> gmake: *** [sha1_file.o] Error 1
> 
> got it... a bit messy, but here it is:
> 
> Subject: [PATCH] fix for openbsd
> 
> ---
> 
>  sha1_file.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> applies-to: b16bae041dfd1c1081873f2e88a5f82858fb2051
> 28dcc3eaf13856585a81a24f1b4393032f825053
> diff --git a/sha1_file.c b/sha1_file.c
> index 7fdc469..1079ca5 100644
> --- a/sha1_file.c
> +++ b/sha1_file.c
> @@ -1244,7 +1244,11 @@ int move_temp_to_file(const char *tmpfil
>  		 * When this succeeds, we just return 0. We have nothing
>  		 * left to unlink.
>  		 */
> -		if ((ret == EXDEV || ret == ENOTSUP) && !rename(tmpfile, filename))
> +		if ((ret == EXDEV
> +#ifdef ENOTSUP
> +                     || ret == ENOTSUP
> +#endif
> +		     ) && !rename(tmpfile, filename))
This is EVIL.... why not just:
  #ifndef ENOTSUP
  #define ENOTSUP EXDEV
  #endif

someplace where it doesn't hurt the eyes? (The EXDEV makes the ENOTSUPP fold away, I presume; not that it should really matter).

-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513
Previous: Johannes SchindelinNext: Randal L. Schwartz
Message 14 of 17 in “git 565ebbf79f61873042c22a7126d002c104e056f4 broken on OpenBSD”
  1. Randal L. SchwartzOct 26, 2005
  2. Randal L. SchwartzOct 26, 2005
  3. Johannes SchindelinOct 26, 2005
  4. Randal L. SchwartzOct 26, 2005
  5. Johannes SchindelinOct 26, 2005
  6. Randal L. SchwartzOct 26, 2005
  7. Jan HarkesOct 26, 2005
  8. Johannes SchindelinOct 26, 2005
  9. Jan HarkesOct 26, 2005
  10. Johannes SchindelinOct 26, 2005
  11. Linus TorvaldsOct 26, 2005
  12. Linus TorvaldsOct 26, 2005
  13. Johannes SchindelinOct 26, 2005
  14. Horst von BrandOct 26, 2005
  15. Randal L. SchwartzOct 26, 2005
  16. Junio C HamanoOct 26, 2005
  17. Randal L. SchwartzOct 26, 2005

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.