summaryrefslogtreecommitdiff
path: root/nss/protocols.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-10-11 20:12:59 +0000
committerArthur de Jong <arthur@arthurdejong.org>2010-10-11 20:12:59 +0000
commit90fec72d7d1390d0744622928c6648355d3f6f33 (patch)
treebd09214dd94179b152d738e8d4798bd9595b86df /nss/protocols.c
parent11428fdf252a18551d64fb6a119e44eab2d2c5d9 (diff)
also try to support older Solaris releases that do not have the returnlen member of struct nss_XbyY_args
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1262 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss/protocols.c')
-rw-r--r--nss/protocols.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/nss/protocols.c b/nss/protocols.c
index 8c55cc3..75c5f32 100644
--- a/nss/protocols.c
+++ b/nss/protocols.c
@@ -93,6 +93,8 @@ nss_status_t _nss_ldap_endprotoent(void)
#ifdef NSS_FLAVOUR_SOLARIS
+#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN
+
static nss_status_t read_protostring(TFILE *fp,nss_XbyY_args_t *args)
{
struct protoent result;
@@ -128,8 +130,17 @@ static nss_status_t read_protostring(TFILE *fp,nss_XbyY_args_t *args)
NSS_ARGS(args)->buf.result? \
read_protoent(fp,(struct protoent *)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno): \
read_protostring(fp,args); \
- if (NSS_ARGS(args)->buf.result) \
- NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result
+ if ((NSS_ARGS(args)->buf.result)&&(retv=NSS_STATUS_SUCCESS)) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#else /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
+
+#define READ_RESULT(fp) \
+ read_protoent(fp,(struct protoent *)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno); \
+ if (retv=NSS_STATUS_SUCCESS) \
+ NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.result;
+
+#endif /* not HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN */
static nss_status_t get_getprotobyname(nss_backend_t UNUSED(*be),void *args)
{