svn commit: r304216 - head/lib/libc/net
Brooks Davis
brooks at FreeBSD.org
Tue Aug 16 11:38:46 UTC 2016
Author: brooks
Date: Tue Aug 16 11:38:45 2016
New Revision: 304216
URL: https://svnweb.freebsd.org/changeset/base/304216
Log:
Don't conflate enum nss_status return values values with int (NS_SUCCESS,
NS_RETURN) values.
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D6046
Modified:
head/lib/libc/net/nss_compat.c
Modified: head/lib/libc/net/nss_compat.c
==============================================================================
--- head/lib/libc/net/nss_compat.c Tue Aug 16 09:12:45 2016 (r304215)
+++ head/lib/libc/net/nss_compat.c Tue Aug 16 11:38:45 2016 (r304216)
@@ -97,9 +97,9 @@ __nss_compat_getgrnam_r(void *retval, vo
const char *name;
struct group *grp;
char *buffer;
- int *errnop;
+ int *errnop, ns_status;
size_t bufsize;
- enum nss_status status;
+ enum nss_status nss_status;
fn = mdata;
name = va_arg(ap, const char *);
@@ -107,11 +107,11 @@ __nss_compat_getgrnam_r(void *retval, vo
buffer = va_arg(ap, char *);
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
- status = fn(name, grp, buffer, bufsize, errnop);
- status = __nss_compat_result(status, *errnop);
- if (status == NS_SUCCESS)
+ nss_status = fn(name, grp, buffer, bufsize, errnop);
+ ns_status = __nss_compat_result(nss_status, *errnop);
+ if (ns_status == NS_SUCCESS)
*(struct group **)retval = grp;
- return (status);
+ return (ns_status);
}
@@ -122,9 +122,9 @@ __nss_compat_getgrgid_r(void *retval, vo
gid_t gid;
struct group *grp;
char *buffer;
- int *errnop;
+ int *errnop, ns_status;
size_t bufsize;
- enum nss_status status;
+ enum nss_status nss_status;
fn = mdata;
gid = va_arg(ap, gid_t);
@@ -132,11 +132,11 @@ __nss_compat_getgrgid_r(void *retval, vo
buffer = va_arg(ap, char *);
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
- status = fn(gid, grp, buffer, bufsize, errnop);
- status = __nss_compat_result(status, *errnop);
- if (status == NS_SUCCESS)
+ nss_status = fn(gid, grp, buffer, bufsize, errnop);
+ ns_status = __nss_compat_result(nss_status, *errnop);
+ if (ns_status == NS_SUCCESS)
*(struct group **)retval = grp;
- return (status);
+ return (ns_status);
}
@@ -146,9 +146,9 @@ __nss_compat_getgrent_r(void *retval, vo
int (*fn)(struct group *, char *, size_t, int *);
struct group *grp;
char *buffer;
- int *errnop;
+ int *errnop, ns_status;
size_t bufsize;
- enum nss_status status;
+ enum nss_status nss_status;
if (CHECK_TERMINATOR(group))
return (NS_NOTFOUND);
@@ -157,13 +157,13 @@ __nss_compat_getgrent_r(void *retval, vo
buffer = va_arg(ap, char *);
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
- status = fn(grp, buffer, bufsize, errnop);
- status = __nss_compat_result(status, *errnop);
- if (status == NS_SUCCESS)
+ nss_status = fn(grp, buffer, bufsize, errnop);
+ ns_status = __nss_compat_result(nss_status, *errnop);
+ if (ns_status == NS_SUCCESS)
*(struct group **)retval = grp;
- else if (status != NS_RETURN)
+ else if (ns_status != NS_RETURN)
SET_TERMINATOR(group, &terminator);
- return (status);
+ return (ns_status);
}
@@ -198,9 +198,9 @@ __nss_compat_getpwnam_r(void *retval, vo
const char *name;
struct passwd *pwd;
char *buffer;
- int *errnop;
+ int *errnop, ns_status;
size_t bufsize;
- enum nss_status status;
+ enum nss_status nss_status;
fn = mdata;
name = va_arg(ap, const char *);
@@ -208,11 +208,11 @@ __nss_compat_getpwnam_r(void *retval, vo
buffer = va_arg(ap, char *);
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
- status = fn(name, pwd, buffer, bufsize, errnop);
- status = __nss_compat_result(status, *errnop);
- if (status == NS_SUCCESS)
+ nss_status = fn(name, pwd, buffer, bufsize, errnop);
+ ns_status = __nss_compat_result(nss_status, *errnop);
+ if (ns_status == NS_SUCCESS)
*(struct passwd **)retval = pwd;
- return (status);
+ return (ns_status);
}
@@ -223,9 +223,9 @@ __nss_compat_getpwuid_r(void *retval, vo
uid_t uid;
struct passwd *pwd;
char *buffer;
- int *errnop;
+ int *errnop, ns_status;
size_t bufsize;
- enum nss_status status;
+ enum nss_status nss_status;
fn = mdata;
uid = va_arg(ap, uid_t);
@@ -233,11 +233,11 @@ __nss_compat_getpwuid_r(void *retval, vo
buffer = va_arg(ap, char *);
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
- status = fn(uid, pwd, buffer, bufsize, errnop);
- status = __nss_compat_result(status, *errnop);
- if (status == NS_SUCCESS)
+ nss_status = fn(uid, pwd, buffer, bufsize, errnop);
+ ns_status = __nss_compat_result(nss_status, *errnop);
+ if (ns_status == NS_SUCCESS)
*(struct passwd **)retval = pwd;
- return (status);
+ return (ns_status);
}
@@ -247,9 +247,9 @@ __nss_compat_getpwent_r(void *retval, vo
int (*fn)(struct passwd *, char *, size_t, int *);
struct passwd *pwd;
char *buffer;
- int *errnop;
+ int *errnop, ns_status;
size_t bufsize;
- enum nss_status status;
+ enum nss_status nss_status;
if (CHECK_TERMINATOR(passwd))
return (NS_NOTFOUND);
@@ -258,13 +258,13 @@ __nss_compat_getpwent_r(void *retval, vo
buffer = va_arg(ap, char *);
bufsize = va_arg(ap, size_t);
errnop = va_arg(ap, int *);
- status = fn(pwd, buffer, bufsize, errnop);
- status = __nss_compat_result(status, *errnop);
- if (status == NS_SUCCESS)
+ nss_status = fn(pwd, buffer, bufsize, errnop);
+ ns_status = __nss_compat_result(nss_status, *errnop);
+ if (ns_status == NS_SUCCESS)
*(struct passwd **)retval = pwd;
- else if (status != NS_RETURN)
+ else if (ns_status != NS_RETURN)
SET_TERMINATOR(passwd, &terminator);
- return (status);
+ return (ns_status);
}
More information about the svn-src-head
mailing list