-/* Copyright (C) 1996-1998,2001-2003,2006,2009,2010
- Free Software Foundation, Inc.
+/* Copyright (C) 1996-2017 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#include <assert.h>
#include <ctype.h>
#include <nss.h>
#include <pwd.h>
#include <string.h>
-#include <bits/libc-lock.h>
+#include <libc-lock.h>
#include <rpcsvc/yp.h>
#include <rpcsvc/ypclnt.h>
{
struct response_t *bucket = intern->next;
- if (__builtin_expect (bucket == NULL, 0))
+ if (__glibc_unlikely (bucket == NULL))
{
#define MINSIZE 4096 - 4 * sizeof (void *)
const size_t minsize = MAX (MINSIZE, 2 * (invallen + 1));
}
char *p = mempcpy (&bucket->mem[intern->offset], inval, invallen);
- if (__builtin_expect (p[-1] != '\0', 0))
+ if (__glibc_unlikely (p[-1] != '\0'))
{
*p = '\0';
++invallen;
{
/* We have to read all the data now. */
char *domain;
- if (__builtin_expect (yp_get_default_domain (&domain), 0))
+ if (__glibc_unlikely (yp_get_default_domain (&domain)))
return NSS_STATUS_UNAVAIL;
struct ypall_callback ypcb;
handle_batch_read:
bucket = intern.next;
- if (__builtin_expect (intern.offset >= bucket->size, 0))
+ if (__glibc_unlikely (intern.offset >= bucket->size))
{
if (bucket->next == NULL)
return NSS_STATUS_NOTFOUND;
yperr = yp_next (domain, "passwd.byname", oldkey, oldkeylen,
&outkey, &keylen, &result, &len);
- if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+ if (__glibc_unlikely (yperr != YPERR_SUCCESS))
{
enum nss_status retval = yperr2nss (yperr);
else
{
non_adjunct:
- if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+ if (__glibc_unlikely ((size_t) (len + 1) > buflen))
{
free (result);
*errnop = ERANGE;
parse_res = _nss_files_parse_pwent (p, pwd, (void *) buffer, buflen,
errnop);
- if (__builtin_expect (parse_res == -1, 0))
+ if (__glibc_unlikely (parse_res == -1))
{
if (!batch_read)
free (outkey);
}
char *domain;
- if (__builtin_expect (yp_get_default_domain (&domain), 0))
+ if (__glibc_unlikely (yp_get_default_domain (&domain)))
return NSS_STATUS_UNAVAIL;
size_t namelen = strlen (name);
int len;
int yperr = yp_match (domain, "passwd.byname", name, namelen, &result, &len);
- if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+ if (__glibc_unlikely (yperr != YPERR_SUCCESS))
{
enum nss_status retval = yperr2nss (yperr);
else
{
non_adjunct:
- if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+ if (__glibc_unlikely ((size_t) (len + 1) > buflen))
{
free (result);
*errnop = ERANGE;
int parse_res = _nss_files_parse_pwent (p, pwd, (void *) buffer, buflen,
errnop);
- if (__builtin_expect (parse_res < 1, 0))
+ if (__glibc_unlikely (parse_res < 1))
{
if (parse_res == -1)
return NSS_STATUS_TRYAGAIN;
char *buffer, size_t buflen, int *errnop)
{
char *domain;
- if (__builtin_expect (yp_get_default_domain (&domain), 0))
+ if (__glibc_unlikely (yp_get_default_domain (&domain)))
return NSS_STATUS_UNAVAIL;
char buf[32];
int len;
int yperr = yp_match (domain, "passwd.byuid", buf, nlen, &result, &len);
- if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
+ if (__glibc_unlikely (yperr != YPERR_SUCCESS))
{
enum nss_status retval = yperr2nss (yperr);
else
{
non_adjunct:
- if (__builtin_expect ((size_t) (len + 1) > buflen, 0))
+ if (__glibc_unlikely ((size_t) (len + 1) > buflen))
{
free (result);
*errnop = ERANGE;
int parse_res = _nss_files_parse_pwent (p, pwd, (void *) buffer, buflen,
errnop);
- if (__builtin_expect (parse_res < 1, 0))
+ if (__glibc_unlikely (parse_res < 1))
{
if (parse_res == -1)
return NSS_STATUS_TRYAGAIN;