+1999-06-28 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/unix/sysv/linux/gethostid.c: Test for gethostbyname_r
+ function correctly.
+
+ * sunrpc/getrpcport.c: Test for gethostbyname_r function
+ correctly.
+
+ * sunrpc/clnt_simp.c: Test for gethostbyname_r function correctly.
+
+ * sunrpc/clnt_gen.c: Test for gethostbyname_r and getprotobyname_r
+ functions correctly.
+
+ * inet/rexec.c (rexec): Test for gethostbyname_r result correctly.
+
+ * inet/rcmd.c: Test for gethostbyname_r result correctly. Optimize
+ file reading a bit.
+
+ * sysdeps/generic/glob.c: Test for getpwnam_r result correctly.
+
+1999-06-28 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * manual/string.texi (Copying and Concatenation): Mention that
+ strndup is a GNU extension.
+
+1999-06-28 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * pwd/getpw.c (__getpw): Fix check for error return.
+
1999-06-25 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* elf/dl-deps.c (_dl_map_object_deps): When looking for the next
hstbuflen = 1024;
tmphstbuf = __alloca (hstbuflen);
while (__gethostbyname_r (*ahost, &hostbuf, tmphstbuf, hstbuflen,
- &hp, &herr) < 0)
+ &hp, &herr) != 0)
if (herr != NETDB_INTERNAL || errno != ERANGE)
{
__set_h_errno (herr);
buffer = __alloca (buflen);
save_errno = errno;
while (__gethostbyname_r (lhost, &hostbuf, buffer, buflen, &hp, &herr)
- < 0)
+ != 0)
if (herr != NETDB_INTERNAL || errno != ERANGE)
return (0);
else {
/* Skip lines that are too long. */
if (strchr (p, '\n') == NULL) {
- int ch = getc (hostf);
+ int ch = getc_unlocked (hostf);
while (ch != '\n' && ch != EOF)
- ch = getc (hostf);
+ ch = getc_unlocked (hostf);
continue;
}
hstbuflen = 1024;
hsttmpbuf = __alloca (hstbuflen);
while (__gethostbyname_r (*ahost, &hostbuf, hsttmpbuf, hstbuflen,
- &hp, &herr) < 0)
+ &hp, &herr) != 0)
if (herr != NETDB_INTERNAL || errno != ERANGE)
{
__set_h_errno (herr);
This function is different to @code{strncpy} in that it always
terminates the destination string.
+
+@code{strndup} is a GNU extension.
@end deftypefun
@comment string.h
-/* Copyright (C) 1991, 1992, 1996, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
buflen = __sysconf (_SC_GETPW_R_SIZE_MAX);
tmpbuf = alloca (buflen);
- if (__getpwuid_r (uid, &resbuf, tmpbuf, buflen, &p) < 0)
+ if (__getpwuid_r (uid, &resbuf, tmpbuf, buflen, &p) != 0)
return -1;
if (sprintf (buf, "%s:%s:%lu:%lu:%s:%s:%s", p->pw_name, p->pw_passwd,
hstbuflen = 1024;
hsttmpbuf = __alloca (hstbuflen);
while (__gethostbyname_r (hostname, &hostbuf, hsttmpbuf, hstbuflen,
- &h, &herr) < 0)
+ &h, &herr) != 0)
if (herr != NETDB_INTERNAL || errno != ERANGE)
{
rpc_createerr.cf_stat = RPC_UNKNOWNHOST;
prtbuflen = 1024;
prttmpbuf = __alloca (prtbuflen);
- while (__getprotobyname_r (proto, &protobuf, prttmpbuf, prtbuflen, &p)
- < 0)
+ while (__getprotobyname_r (proto, &protobuf, prttmpbuf, prtbuflen, &p) != 0)
if (errno != ERANGE)
{
rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
buflen = 1024;
buffer = __alloca (buflen);
while (__gethostbyname_r (host, &hostbuf, buffer, buflen,
- &hp, &herr) < 0)
+ &hp, &herr) != 0)
if (herr != NETDB_INTERNAL || errno != ERANGE)
return (int) RPC_UNKNOWNHOST;
else
buflen = 1024;
buffer = __alloca (buflen);
- while (__gethostbyname_r (host, &hostbuf, buffer, buflen, &hp, &herr)
- < 0)
+ while (__gethostbyname_r (host, &hostbuf, buffer, buflen, &hp, &herr) != 0)
if (herr != NETDB_INTERNAL || errno != ERANGE)
return 0;
else
pwtmpbuf = (char *) __alloca (pwbuflen);
success = 1;
- while (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p) < 0)
+ while (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p)
+ != 0)
{
if (errno != ERANGE)
{
buflen = 1024;
pwtmpbuf = (char *) __alloca (buflen);
- while (getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) < 0)
+ while (getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) != 0)
{
if (errno != ERANGE)
{
-/* Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
/* To get the IP address we need to know the host name. */
while (__gethostbyname_r (hostname, &hostbuf, buffer, buflen, &hp, &herr)
- < 0)
+ != 0)
if (herr != NETDB_INTERNAL || errno != ERANGE)
return 0;
else