* [PATCH [rpcbind]] fix building one systems w/out nss.h @ 2013-02-19 18:48 Mike Frysinger 2013-02-19 18:54 ` Chuck Lever 2013-02-21 15:43 ` Steve Dickson 0 siblings, 2 replies; 5+ messages in thread From: Mike Frysinger @ 2013-02-19 18:48 UTC (permalink / raw) To: libtirpc-devel; +Cc: linux-nfs 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. URL: http://bugs.gentoo.org/458024 Reported-by: Mark Reiche <porphyr@gmx.de> Signed-off-by: Mike Frysinger <vapier@gentoo.org> --- src/rpcbind.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rpcbind.c b/src/rpcbind.c index 9a0504d..83dbe93 100644 --- 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 #include "rpcbind.h" /*#define RPCBIND_DEBUG*/ -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH [rpcbind]] fix building one systems w/out nss.h 2013-02-19 18:48 [PATCH [rpcbind]] fix building one systems w/out nss.h Mike Frysinger @ 2013-02-19 18:54 ` Chuck Lever 2013-02-19 19:14 ` Mike Frysinger 2013-02-21 15:43 ` Steve Dickson 1 sibling, 1 reply; 5+ messages in thread From: Chuck Lever @ 2013-02-19 18:54 UTC (permalink / raw) To: Mike Frysinger; +Cc: libtirpc-devel, linux-nfs Hi- On Feb 19, 2013, at 1:48 PM, Mike Frysinger <vapier@gentoo.org> 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. > > URL: http://bugs.gentoo.org/458024 > Reported-by: Mark Reiche <porphyr@gmx.de> > Signed-off-by: Mike Frysinger <vapier@gentoo.org> > --- > src/rpcbind.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/src/rpcbind.c b/src/rpcbind.c > index 9a0504d..83dbe93 100644 > --- 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. > #include "rpcbind.h" > > /*#define RPCBIND_DEBUG*/ -- Chuck Lever chuck[dot]lever[at]oracle[dot]com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH [rpcbind]] fix building one systems w/out nss.h 2013-02-19 18:54 ` Chuck Lever @ 2013-02-19 19:14 ` Mike Frysinger 2013-02-19 19:16 ` Chuck Lever 0 siblings, 1 reply; 5+ messages in thread From: Mike Frysinger @ 2013-02-19 19:14 UTC (permalink / raw) To: Chuck Lever; +Cc: libtirpc-devel, linux-nfs [-- Attachment #1: Type: Text/Plain, Size: 1239 bytes --] On Tuesday 19 February 2013 13:54:19 Chuck Lever wrote: > On Feb 19, 2013, at 1:48 PM, Mike Frysinger <vapier@gentoo.org> 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 #2: This is a digitally signed message part. --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH [rpcbind]] fix building one systems w/out nss.h 2013-02-19 19:14 ` Mike Frysinger @ 2013-02-19 19:16 ` Chuck Lever 0 siblings, 0 replies; 5+ messages in thread From: Chuck Lever @ 2013-02-19 19:16 UTC (permalink / raw) To: Mike Frysinger; +Cc: libtirpc-devel, linux-nfs On Feb 19, 2013, at 2:14 PM, Mike Frysinger <vapier@gentoo.org> wrote: > On Tuesday 19 February 2013 13:54:19 Chuck Lever wrote: >> On Feb 19, 2013, at 1:48 PM, Mike Frysinger <vapier@gentoo.org> 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. OK, clear. Sorry to be dense. > > also, i typoed the subject name ("one" vs "on"). > -mike -- Chuck Lever chuck[dot]lever[at]oracle[dot]com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH [rpcbind]] fix building one systems w/out nss.h 2013-02-19 18:48 [PATCH [rpcbind]] fix building one systems w/out nss.h Mike Frysinger 2013-02-19 18:54 ` Chuck Lever @ 2013-02-21 15:43 ` Steve Dickson 1 sibling, 0 replies; 5+ messages in thread From: Steve Dickson @ 2013-02-21 15:43 UTC (permalink / raw) To: Mike Frysinger; +Cc: libtirpc-devel, linux-nfs On 19/02/13 13:48, Mike Frysinger 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. > > URL: http://bugs.gentoo.org/458024 > Reported-by: Mark Reiche <porphyr@gmx.de> > Signed-off-by: Mike Frysinger <vapier@gentoo.org> Committed... steved. > --- > src/rpcbind.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/src/rpcbind.c b/src/rpcbind.c > index 9a0504d..83dbe93 100644 > --- 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 > #include "rpcbind.h" > > /*#define RPCBIND_DEBUG*/ > -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-02-21 15:43 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-02-19 18:48 [PATCH [rpcbind]] fix building one systems w/out nss.h Mike Frysinger 2013-02-19 18:54 ` Chuck Lever 2013-02-19 19:14 ` Mike Frysinger 2013-02-19 19:16 ` Chuck Lever 2013-02-21 15:43 ` Steve Dickson
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox