diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2010-10-11 22:12:59 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2010-10-11 22:12:59 +0200 |
commit | 90fec72d7d1390d0744622928c6648355d3f6f33 (patch) | |
tree | bd09214dd94179b152d738e8d4798bd9595b86df /nss/ethers.c | |
parent | 11428fdf252a18551d64fb6a119e44eab2d2c5d9 (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/ethers.c')
-rw-r--r-- | nss/ethers.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/nss/ethers.c b/nss/ethers.c index 56cc0ee..75b09e9 100644 --- a/nss/ethers.c +++ b/nss/ethers.c @@ -96,6 +96,8 @@ nss_status_t _nss_ldap_endetherent(void) #define NSS_BUFLEN_ETHERS 1024 #endif /* NSS_BUFLEN_ETHERS */ +#ifdef HAVE_STRUCT_NSS_XBYY_ARGS_RETURNLEN + static nss_status_t read_etherstring(TFILE *fp,nss_XbyY_args_t *args) { /* TODO: padl uses struct ether, verify */ @@ -129,8 +131,17 @@ static nss_status_t read_etherstring(TFILE *fp,nss_XbyY_args_t *args) NSS_ARGS(args)->buf.result? \ read_etherent(fp,(struct etherent *)NSS_ARGS(args)->buf.result,NSS_ARGS(args)->buf.buffer,NSS_ARGS(args)->buf.buflen,&errno): \ read_etherstring(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_etherent(fp,(struct etherent *)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 */ /* map a hostname to the corresponding ethernet address */ static nss_status_t get_gethostton(nss_backend_t UNUSED(*be),void *args) |