Re: [PATCH] git-compat-util.h: Fix build without threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Nov 26, 2022 at 12:47:27AM +0100, Ævar Arnfjörð Bjarmason wrote:

> On Fri, Nov 25 2022, Bagas Sanjaya wrote:
> 
> > From: Fabrice Fontaine <fontaine.fabrice@xxxxxxxxx>
> >
> > Git build with toolchains without threads support is broken (as reported
> > by Buildroot autobuilder [1]) since version 2.29.0, which traces back to
> 
> > --- a/git-compat-util.h
> > +++ b/git-compat-util.h
> > @@ -1470,7 +1470,8 @@ int open_nofollow(const char *path, int flags);
> >  # define SHELL_PATH "/bin/sh"
> >  #endif
> >  
> > -#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
> > +
> > +#if !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(NO_FLOCKFILE)
> 
> Per f43cce23add (git-compat-util: add fallbacks for unlocked stdio,
> 2015-04-16) wouldn't it make more sense to do something like:
> 
> #ifdef NO_FLOCKFILE
> #undef _POSIX_THREAD_SAFE_FUNCTIONS
> #endif

That doesn't work, because the NO_FLOCKFILE is actually overriding the
_lack_ of _POSIX_THREAD_SAFE_FUNCTIONS. So it's kind of confusingly
named. In this patch, NO_FLOCKFILE means "do not define a noop wrapper
flockfile()", which can only work if the system really does define it.

I do think this patch is doing the wrong thing, though. See my other
reply.

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux