Cleanup of db-XXX.c

This commit is contained in:
Ulrich Drepper 2011-06-15 21:00:59 -04:00
parent 9f2da732e7
commit 40c1b22cd7
2 changed files with 70 additions and 72 deletions

View File

@ -1,5 +1,7 @@
2011-06-15 Ulrich Drepper <drepper@gmail.com>
* nss/nss_db/db-XXX.c: Cleanup.
* nss/Makefile (libnss_db-dbs): Add db-initgroups.
* nss/Versions [libnss_db]: Add _nss_db_initgroups_dyn for
GLIBC_PRIVATE.

View File

@ -122,8 +122,6 @@ enum nss_status \
_nss_db_get##name##_r (proto, struct STRUCTURE *result, \
char *buffer, size_t buflen, int *errnop H_ERRNO_PROTO)\
{ \
enum nss_status status = NSS_STATUS_SUCCESS; \
struct nss_db_map state = { NULL, 0 }; \
struct parser_data *data = (void *) buffer; \
\
if (buflen < sizeof *data) \
@ -133,7 +131,8 @@ enum nss_status \
return NSS_STATUS_TRYAGAIN; \
} \
\
status = internal_setent (DBFILE, &state); \
struct nss_db_map state = { NULL, 0 }; \
enum nss_status status = internal_setent (DBFILE, &state); \
if (status != NSS_STATUS_SUCCESS) \
{ \
*errnop = errno; \
@ -141,8 +140,6 @@ enum nss_status \
return status; \
} \
\
if (status == NSS_STATUS_SUCCESS) \
{ \
const struct nss_db_header *header = state.header; \
int i; \
for (i = 0; i < header->ndbs; ++i) \
@ -190,8 +187,7 @@ enum nss_status \
/* Copy the string to a place where it can be modified. */ \
char *p = memcpy (buffer, valstr, len); \
\
int err = parse_line (p, result, data, buflen, errnop \
EXTRA_ARGS); \
int err = parse_line (p, result, data, buflen, errnop EXTRA_ARGS); \
if (err > 0) \
{ \
status = NSS_STATUS_SUCCESS; \
@ -211,7 +207,7 @@ enum nss_status \
\
if (status == NSS_STATUS_NOTFOUND) \
H_ERRNO_SET (HOST_NOT_FOUND); \
} \
\
out: \
internal_endent (&state); \
\