version 1.50.2.2, 2012/10/30 18:58:45 |
version 1.53.2.1, 2017/07/23 06:08:17 |
Line 45 __RCSID("$NetBSD$"); |
|
Line 45 __RCSID("$NetBSD$"); |
|
#endif |
#endif |
#endif /* LIBC_SCCS and not lint */ |
#endif /* LIBC_SCCS and not lint */ |
|
|
#ifndef SMALL |
#ifndef LIBHACK |
#include "namespace.h" |
#include "namespace.h" |
#endif |
#endif |
#include <sys/types.h> |
#include <sys/types.h> |
Line 65 __RCSID("$NetBSD$"); |
|
Line 65 __RCSID("$NetBSD$"); |
|
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
#if defined(__weak_alias) && !defined(SMALL) |
#if defined(__weak_alias) && !defined(LIBHACK) |
__weak_alias(cgetcap,_cgetcap) |
__weak_alias(cgetcap,_cgetcap) |
__weak_alias(cgetclose,_cgetclose) |
__weak_alias(cgetclose,_cgetclose) |
__weak_alias(cgetent,_cgetent) |
__weak_alias(cgetent,_cgetent) |
|
|
getent(char **cap, size_t *len, const char * const *db_array, int fd, |
getent(char **cap, size_t *len, const char * const *db_array, int fd, |
const char *name, int depth, char *nfield) |
const char *name, int depth, char *nfield) |
{ |
{ |
#ifndef SMALL |
|
DB *capdbp; |
|
char pbuf[MAXPATHLEN]; |
|
char *cbuf; |
|
int retval; |
|
size_t clen; |
|
#endif |
|
char *record, *newrecord; |
char *record, *newrecord; |
char *r_end, *rp; /* pacify gcc */ |
char *r_end, *rp; /* pacify gcc */ |
const char * const *db_p; |
const char * const *db_p; |
Line 322 getent(char **cap, size_t *len, const ch |
|
Line 315 getent(char **cap, size_t *len, const ch |
|
(void)lseek(fd, (off_t)0, SEEK_SET); |
(void)lseek(fd, (off_t)0, SEEK_SET); |
} else { |
} else { |
#ifndef SMALL |
#ifndef SMALL |
|
DB *capdbp; |
|
char pbuf[MAXPATHLEN]; |
|
char *cbuf; |
|
int retval; |
|
size_t clen; |
|
|
(void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); |
(void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p); |
if (expandtc && |
if ((capdbp = dbopen(pbuf, O_RDONLY, 0, DB_HASH, 0)) |
(capdbp = dbopen(pbuf, O_RDONLY, 0, DB_HASH, 0)) |
|
!= NULL) { |
!= NULL) { |
free(record); |
free(record); |
retval = cdbget(capdbp, &record, name); |
retval = cdbget(capdbp, &record, name); |