-/* Copyright (C) 2007, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2007.
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
+ <https://www.gnu.org/licenses/>. */
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <not-cancel.h>
-#include <stdio-common/_itoa.h>
+#include <_itoa.h>
+#include <stdint.h>
#include "nscd-client.h"
#include "nscd_proto.h"
portstr[sizeof (portstr) - 1] = '\0';
char *cp = _itoa_word (port, portstr + sizeof (portstr) - 1, 10, 0);
- return nscd_getserv_r (cp, portstr + sizeof (portstr) - cp, proto,
+ return nscd_getserv_r (cp, portstr + sizeof (portstr) - 1 - cp, proto,
GETSERVBYPORT, result_buf, buf, buflen, result);
}
> recend, 0))
goto out;
-#ifndef _STRING_ARCH_unaligned
+#if !_STRING_ARCH_unaligned
/* The aliases_len array in the mapped database might very
well be unaligned. We will access it word-wise so on
platforms which do not tolerate unaligned accesses we
/* No value found so far. */
*result = NULL;
- if (__builtin_expect (serv_resp.found == -1, 0))
+ if (__glibc_unlikely (serv_resp.found == -1))
{
/* The daemon does not cache this database. */
__nss_not_use_nscd_services = 1;
}
/* See whether this would exceed the buffer capacity. */
- if (__builtin_expect (cp > buf + buflen, 0))
+ if (__glibc_unlikely (cp > buf + buflen))
{
/* aliases_len array might contain garbage during nscd GC cycle,
retry rather than fail in that case. */
out_close:
if (sock != -1)
- close_not_cancel_no_status (sock);
+ __close_nocancel_nostatus (sock);
out:
if (__nscd_drop_map_ref (mapped, &gc_cycle) != 0)
{