Re: [PATCH [rpcbind]] fix building one systems w/out nss.h

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

 



On Tuesday 19 February 2013 13:54:19 Chuck Lever wrote:
> On Feb 19, 2013, at 1:48 PM, Mike Frysinger <vapier@xxxxxxxxxx> wrote:
> > The nss.h header is glibc-specific, so use the existing HAVE_NSS_H define
> > to avoid including/using it when it is not available.
> > --- a/src/rpcbind.c
> > +++ b/src/rpcbind.c
> > @@ -67,7 +67,11 @@
> > #include <pwd.h>
> > #include <string.h>
> > #include <errno.h>
> > +#ifdef HAVE_NSS_H
> > #include <nss.h>
> > +#else
> > +static inline void __nss_configure_lookup(const char *db, const char *s)
> > {} +#endif
> 
> Where is rpcbind getting the __nss_configure_lookup() function in this
> case?  I don't see that the call sites are ifdef-d out if HAVE_NSS_H is
> not defined.

i'm not sure what you mean.

if nss.h exists, then HAVE_NSS_H is defined, and the nss.h header provides the 
__nss_configure_lookup prototype (and presumably, the C library provides that 
func).

if nss.h doesn't exist, then HAVE_NSS_H is not defined, so we have to stub out 
the __nss_configure_lookup func.  i could have put "#ifdef HAVE_NSS_H" around 
all the call sites, but i think this version is cleaner and less error prone.

also, i typoed the subject name ("one" vs "on").
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux