aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog52
-rw-r--r--elf/dl-support.c20
-rw-r--r--elf/readlib.c10
-rw-r--r--fedora/branch.mk4
-rw-r--r--fedora/glibc.spec.in7
-rw-r--r--math/libm-test.inc2
-rw-r--r--posix/Makefile3
-rw-r--r--posix/tst-getaddrinfo2.c75
-rwxr-xr-xscripts/test-installation.pl7
-rw-r--r--sunrpc/clnt_udp.c35
-rw-r--r--sunrpc/get_myaddr.c53
-rw-r--r--sunrpc/pmap_clnt.c56
-rw-r--r--sunrpc/pmap_rmt.c65
-rw-r--r--sysdeps/alpha/alphaev6/memcpy.S1
-rw-r--r--sysdeps/generic/bits/types.h6
-rw-r--r--sysdeps/generic/s_fdim.c4
-rw-r--r--sysdeps/generic/s_fdimf.c4
-rw-r--r--sysdeps/generic/s_fdiml.c4
-rw-r--r--sysdeps/i386/i686/fpu/s_fdim.S10
-rw-r--r--sysdeps/i386/i686/fpu/s_fdimf.S10
-rw-r--r--sysdeps/i386/i686/fpu/s_fdiml.S10
-rw-r--r--sysdeps/posix/getaddrinfo.c41
-rw-r--r--sysdeps/powerpc/fpu/s_fdim.c4
-rw-r--r--sysdeps/powerpc/fpu/s_fdimf.c4
-rw-r--r--sysdeps/unix/alpha/sysdep.h4
-rw-r--r--sysdeps/x86_64/fpu/s_fdiml.S10
26 files changed, 312 insertions, 189 deletions
diff --git a/ChangeLog b/ChangeLog
index b92394eb40..d208b771e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,50 @@
+2004-09-26 Richard Henderson <rth@redhat.com>
+
+ * sysdeps/alpha/alphaev6/memcpy.S: Mark .prologue.
+ * sysdeps/unix/alpha/sysdep.h (LEAF, ENTRY): Align entry points
+ to 16 byte boundaries.
+
+2004-09-26 Ulrich Drepper <drepper@redhat.com>
+
+ * elf/readlib.c (process_file): Before complaining about too-short
+ file, check that it potentially be an ELF file. Also complain about
+ empty files. [BZ #151].
+
+ * scripts/test-installation.pl: Fix ld.so recognition for new
+ LD_TRACE_LOADED_OBJECTS output format.
+ Patch by <jsberg04+computing.glibc@ftml.net> [BZ #407].
+
+ * elf/dl-support.c (_dl_non_dynamic_init): Fix cleaning of
+ environment. [BZ #384]
+
+ * sunrpc/clnt_udp.c (is_network_up): Use getifaddrs instead of ioctl.
+ * sunrpc/get_myaddr.c (get_myaddress): Likewise.
+ * sunrpc/pmap_clnt.c (__get_myaddress): Likewise.
+ * sunrpc/pmap_rmt.c (getbroadcastnets): Likewise. Change interface
+ to avoid buffer overrun and remove now useless parameters.
+ (clnt_broadcast): Adjust caller. [BZ #381].
+
+ * sysdeps/generic/s_fdim.c: Handle +inf/+inf
+ * sysdeps/generic/s_fdimf.c: Likewise.
+ * sysdeps/generic/s_fdiml.c: Likewise.
+ * sysdeps/i386/i686/fpu/s_fdim.S: Likewise.
+ * sysdeps/i386/i686/fpu/s_fdimf.S: Likewise.
+ * sysdeps/i386/i686/fpu/s_fdiml.S: Likewise.
+ * sysdeps/powerpc/fpu/s_fdim.c: Likewise.
+ * sysdeps/powerpc/fpu/s_fdimf.c: Likewise.
+ * sysdeps/x86_64/fpu/s_fdiml.S: Likewise.
+ * math/libm-test.inc (fdim_test): Add test case. [BZ #376].
+
+ * sysdeps/generic/bits/types.h: Fix __SQUAD_TYPE and __UQUAD_TYPE
+ for compilers without __GLIBC_HAVE_LONG_LONG. [BZ #362]
+
+ * sysdeps/posix/getaddrinfo.c (getaddrinfo): Remove incorrect
+ requirement on socktype and protocol.
+ (gaih_inet): If numeric port number is given, return records for all
+ possible socket types.
+ * posix/tst-getaddrinfo2.c: New file.
+ * posix/Makefile (tests): Add tst-getaddrinfo2. [BZ #358]
+
2004-09-25 Ulrich Drepper <drepper@redhat.com>
* locale/loadlocale.c (_nl_intern_locale_data): Recognize LC_CTYPE
@@ -17,10 +64,11 @@
are done. First set to -1 to signal initialization is ongoing.
Protect against concurrent callers with recursive lock.
* intl/finddomain.c (_nl_find_domain): Protect calls to
- _nl_make_l10nflist.
+ _nl_make_l10nflist. [BZ #322]
+
* sysdeps/posix/getaddrinfo.c (getaddrinfo): If determinination of
source address fails, initialized source_addr_len field so that
- duplicate address recognition does not copy junk. [BZ #322]
+ duplicate address recognition does not copy junk.
2004-09-25 Jakub Jelinek <jakub@redhat.com>
diff --git a/elf/dl-support.c b/elf/dl-support.c
index e3df749ae5..8bf6814de2 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -257,22 +257,22 @@ _dl_non_dynamic_init (void)
if (__libc_enable_secure)
{
- static const char *unsecure_envvars[] =
- {
- UNSECURE_ENVVARS,
+ static const char unsecure_envvars[] =
+ UNSECURE_ENVVARS
#ifdef EXTRA_UNSECURE_ENVVARS
EXTRA_UNSECURE_ENVVARS
#endif
- };
- size_t cnt;
+ ;
+ const char *cp = unsecure_envvars;
- for (cnt = 0;
- cnt < sizeof (unsecure_envvars) / sizeof (unsecure_envvars[0]);
- ++cnt)
- unsetenv (unsecure_envvars[cnt]);
+ while (cp < unsecure_envvars + sizeof (unsecure_envvars))
+ {
+ __unsetenv (cp);
+ cp = (const char *) __rawmemchr (cp, '\0') + 1;
+ }
if (__access ("/etc/suid-debug", F_OK) != 0)
- unsetenv ("MALLOC_CHECK_");
+ __unsetenv ("MALLOC_CHECK_");
}
#ifdef DL_PLATFORM_INIT
diff --git a/elf/readlib.c b/elf/readlib.c
index a1fec94589..4fbc3e5e4c 100644
--- a/elf/readlib.c
+++ b/elf/readlib.c
@@ -105,7 +105,15 @@ process_file (const char *real_file_name, const char *file_name,
if ((size_t) statbuf.st_size < sizeof (struct exec)
|| (size_t) statbuf.st_size < sizeof (ElfW(Ehdr)))
{
- error (0, 0, _("File %s is too small, not checked."), file_name);
+ if (statbuf.st_size == 0)
+ error (0, 0, _("File %s is empty, not checked."), file_name);
+ else
+ {
+ char buf[SELFMAG];
+ size_t n = MIN (statbuf.st_size, SELFMAG);
+ if (fread (buf, n, 1, file) == 1 && memcmp (buf, ELFMAG, n) == 0)
+ error (0, 0, _("File %s is too small, not checked."), file_name);
+ }
fclose (file);
return 1;
}
diff --git a/fedora/branch.mk b/fedora/branch.mk
index 46ec6e506d..7a862eaf51 100644
--- a/fedora/branch.mk
+++ b/fedora/branch.mk
@@ -1,5 +1,5 @@
# This file is updated automatically by Makefile.
glibc-branch := fedora
glibc-base := HEAD
-fedora-sync-date := 2004-09-26 08:23 UTC
-fedora-sync-tag := fedora-glibc-20040926T0823
+fedora-sync-date := 2004-09-27 06:11 UTC
+fedora-sync-tag := fedora-glibc-20040927T0611
diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in
index b2cb49a67f..35e9dc74bd 100644
--- a/fedora/glibc.spec.in
+++ b/fedora/glibc.spec.in
@@ -1,4 +1,4 @@
-%define glibcrelease 58
+%define glibcrelease 59
%define auxarches i586 i686 athlon sparcv9 alphaev6
%define prelinkarches noarch
%define nptlarches i386 i686 athlon x86_64 ia64 s390 s390x sparcv9 ppc ppc64
@@ -1239,6 +1239,11 @@ rm -f *.filelist*
%endif
%changelog
+* Mon Sep 27 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-59
+- update from CVS
+ - fix BZ #151, #362, #381, #407
+ - fdim fix for +inf/+inf (BZ #376)
+
* Sun Sep 26 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-58
- update from CVS
- vasprintf fix (BZ #346)
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 729fce9369..b23ec8430f 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -2557,6 +2557,8 @@ fdim_test (void)
TEST_ff_f (fdim, nan_value, minus_infty, nan_value);
TEST_ff_f (fdim, nan_value, nan_value, nan_value);
+ TEST_ff_f (fdim, plus_infty, plus_infty, 0);
+
END (fdim);
}
diff --git a/posix/Makefile b/posix/Makefile
index 766c1dd7f7..82d35378d1 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -81,7 +81,8 @@ tests := tstgetopt testfnm runtests runptests \
bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
bug-regex21 bug-regex22 bug-regex23 tst-nice tst-nanosleep \
transbug tst-rxspencer tst-pcre tst-boost \
- bug-ga1 tst-vfork1 tst-vfork2 tst-waitid
+ bug-ga1 tst-vfork1 tst-vfork2 tst-waitid \
+ tst-getaddrinfo2
xtests := bug-ga2
ifeq (yes,$(build-shared))
test-srcs := globtest
diff --git a/posix/tst-getaddrinfo2.c b/posix/tst-getaddrinfo2.c
new file mode 100644
index 0000000000..b0bce5925c
--- /dev/null
+++ b/posix/tst-getaddrinfo2.c
@@ -0,0 +1,75 @@
+/* Test by David L Stevens <dlstevens@us.ibm.com> [BZ #358] */
+#include <errno.h>
+#include <netdb.h>
+#include <unistd.h>
+#include <sys/socket.h>
+
+static int
+do_test (void)
+{
+ const char portstr[] = "583";
+ int port = atoi (portstr);
+ struct addrinfo hints, *aires, *pai;
+ int rv;
+ int res = 1;
+
+ memset (&hints, 0, sizeof (hints));
+ hints.ai_family = AF_INET;
+ rv = getaddrinfo (NULL, portstr, &hints, &aires);
+ if (rv == 0)
+ {
+ struct sockaddr_in *psin = 0;
+ int got_tcp, got_udp;
+ int err = 0;
+
+ got_tcp = got_udp = 0;
+ for (pai = aires; pai; pai = pai->ai_next)
+ {
+ printf ("ai_family=%d, ai_addrlen=%d, ai_socktype=%d",
+ (int) pai->ai_family, (int) pai->ai_addrlen,
+ (int) pai->ai_socktype);
+ if (pai->ai_family == AF_INET)
+ printf (", port=%d",
+ ntohs (((struct sockaddr_in *) pai->ai_addr)->sin_port));
+ puts ("");
+
+ err |= pai->ai_family != AF_INET;
+ err |= pai->ai_addrlen != sizeof (struct sockaddr_in);
+ err |= pai->ai_addr == 0;
+ if (pai->ai_family == AF_INET)
+ err |=
+ ntohs (((struct sockaddr_in *) pai->ai_addr)->sin_port) != port;
+ got_tcp |= pai->ai_socktype == SOCK_STREAM;
+ got_udp |= pai->ai_socktype == SOCK_DGRAM;
+ if (err)
+ break;
+ }
+ if (err)
+ {
+ printf ("FAIL getaddrinfo IPv4 socktype 0,513: "
+ "fam %d alen %d addr 0x%08X addr/fam %d "
+ "addr/port %d H[%d]\n",
+ pai->ai_family, pai->ai_addrlen, psin,
+ psin ? psin->sin_family : 0,
+ psin ? psin->sin_port : 0,
+ psin ? htons (psin->sin_port) : 0);
+ }
+ else if (got_tcp && got_udp)
+ {
+ printf ("SUCCESS getaddrinfo IPv4 socktype 0,513\n");
+ res = 0;
+ }
+ else
+ printf ("FAIL getaddrinfo IPv4 socktype 0,513 TCP %d"
+ " UDP %d\n", got_tcp, got_udp);
+ freeaddrinfo (aires);
+ }
+ else
+ printf ("FAIL getaddrinfo IPv4 socktype 0,513 returns %d "
+ "(\"%s\")\n", rv, gai_strerror (rv));
+
+ return res;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/scripts/test-installation.pl b/scripts/test-installation.pl
index 981c2ccada..90cd9d7547 100755
--- a/scripts/test-installation.pl
+++ b/scripts/test-installation.pl
@@ -1,5 +1,5 @@
#! /usr/bin/perl -w
-# Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Andreas Jaeger <aj@arthur.rhein-neckar.de>, 1997.
@@ -168,9 +168,8 @@ while (<LDD>) {
}
}
if (/$ld_so_name/) {
- ($version1, $version2) =
- /$ld_so_name\.so\.([0-9\.]*)\s*=>.*\.so\.([0-9\.]*)/;
- if ($version1 ne $version2 || $version1 ne $ld_so_version) {
+ ($version1) = /$ld_so_name\.so\.([0-9\.]*)/;
+ if ($version1 ne $ld_so_version) {
print "The dynamic linker $ld_so_name.so is not correctly installed.\n";
print "Please check your installation!\n";
print "Offending line of ldd output: $_\n";
diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c
index f906173363..1836ff3433 100644
--- a/sunrpc/clnt_udp.c
+++ b/sunrpc/clnt_udp.c
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
#include <errno.h>
#include <rpc/pmap_clnt.h>
#include <net/if.h>
+#include <ifaddrs.h>
#ifdef USE_IN_LIBIO
# include <wchar.h>
#endif
@@ -234,28 +235,24 @@ INTDEF (clntudp_create)
static int
is_network_up (int sock)
{
- struct ifconf ifc;
- char buf[UDPMSGSIZE];
- struct ifreq ifreq, *ifr;
- int n;
-
- ifc.ifc_len = sizeof (buf);
- ifc.ifc_buf = buf;
- if (__ioctl(sock, SIOCGIFCONF, (char *) &ifc) == 0)
+ struct ifaddrs *ifa;
+
+ if (getifaddrs (&ifa) != 0)
+ return 0;
+
+ struct ifaddrs *run = ifa;
+ while (run != NULL)
{
- ifr = ifc.ifc_req;
- for (n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++)
- {
- ifreq = *ifr;
- if (__ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
- break;
+ if ((run->ifa_flags & IFF_UP) != 0
+ && run->ifa_addr->sa_family == AF_INET)
+ break;
- if ((ifreq.ifr_flags & IFF_UP)
- && ifr->ifr_addr.sa_family == AF_INET)
- return 1;
- }
+ run = run->ifa_next;
}
- return 0;
+
+ freeifaddrs (ifa);
+
+ return run != NULL;
}
static enum clnt_stat
diff --git a/sunrpc/get_myaddr.c b/sunrpc/get_myaddr.c
index 7a4bb8cb6f..ee822970f9 100644
--- a/sunrpc/get_myaddr.c
+++ b/sunrpc/get_myaddr.c
@@ -46,6 +46,7 @@ static char sccsid[] = "@(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro";
#include <unistd.h>
#include <libintl.h>
#include <net/if.h>
+#include <ifaddrs.h>
#include <sys/ioctl.h>
/* Order of following two #includes reversed by roland@gnu */
#include <netinet/in.h>
@@ -60,50 +61,42 @@ static char sccsid[] = "@(#)get_myaddress.c 1.4 87/08/11 Copyr 1984 Sun Micro";
void
get_myaddress (struct sockaddr_in *addr)
{
- int s;
- char buf[BUFSIZ];
- struct ifconf ifc;
- struct ifreq ifreq, *ifr;
- int len, loopback = 0;
+ struct ifaddrs *ifa;
- if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0)
+ if (getifaddrs (&ifa) == 0)
{
- perror ("get_myaddress: socket");
- exit (1);
- }
- ifc.ifc_len = sizeof (buf);
- ifc.ifc_buf = buf;
- if (__ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
- {
- perror (_("get_myaddress: ioctl (get interface configuration)"));
+ perror ("get_myaddress: getifaddrs");
exit (1);
}
+ int loopback = 0;
+ struct ifaddrs *run;
+
again:
- ifr = ifc.ifc_req;
- for (len = ifc.ifc_len; len; len -= sizeof ifreq)
+ run = ifa;
+ while (run != NULL)
{
- ifreq = *ifr;
- if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
+ if ((run->ifa_flags & IFF_UP) && run->ifa_addr->sa_family == AF_INET
+ && (!(run->ifa_flags & IFF_LOOPBACK)
+ || (loopback == 1 && (run->ifa_flags & IFF_LOOPBACK))))
{
- perror ("get_myaddress: ioctl");
- exit (1);
- }
- if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
- && (!(ifreq.ifr_flags & IFF_LOOPBACK) ||
- (loopback == 1 && (ifreq.ifr_flags & IFF_LOOPBACK))))
- {
- *addr = *((struct sockaddr_in *) &ifr->ifr_addr);
+ *addr = *((struct sockaddr_in *) run->ifa_addr);
addr->sin_port = htons (PMAPPORT);
- __close (s);
- return;
+ goto out;
}
- ifr++;
+
+ run = run->ifa_next;
}
+
if (loopback == 0)
{
loopback = 1;
goto again;
}
- __close (s);
+ out:
+ freeifaddrs (ifa);
+
+ /* The function is horribly specified. It does not return any error
+ if no interface is up. Probably this won't happen (at least
+ loopback is there) but still... */
}
diff --git a/sunrpc/pmap_clnt.c b/sunrpc/pmap_clnt.c
index d88487d8f4..c968511e96 100644
--- a/sunrpc/pmap_clnt.c
+++ b/sunrpc/pmap_clnt.c
@@ -38,6 +38,7 @@
#include <unistd.h>
#include <libintl.h>
#include <net/if.h>
+#include <ifaddrs.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -54,52 +55,41 @@
static bool_t
__get_myaddress (struct sockaddr_in *addr)
{
- int s;
- char buf[BUFSIZ];
- struct ifconf ifc;
- struct ifreq ifreq, *ifr;
- int len, loopback = 1;
+ struct ifaddrs *ifa;
- if ((s = __socket (AF_INET, SOCK_DGRAM, 0)) < 0)
+ if (getifaddrs (&ifa) == 0)
{
- perror ("__get_myaddress: socket");
- exit (1);
- }
- ifc.ifc_len = sizeof (buf);
- ifc.ifc_buf = buf;
- if (__ioctl (s, SIOCGIFCONF, (char *) &ifc) < 0)
- {
- perror (_("__get_myaddress: ioctl (get interface configuration)"));
+ perror ("get_myaddress: getifaddrs");
exit (1);
}
+ int loopback = 1;
+ struct ifaddrs *run;
+
again:
- ifr = ifc.ifc_req;
- for (len = ifc.ifc_len; len; len -= sizeof ifreq)
+ run = ifa;
+ while (run != NULL)
{
- ifreq = *ifr;
- if (__ioctl (s, SIOCGIFFLAGS, (char *) &ifreq) < 0)
- {
- perror ("__get_myaddress: ioctl");
- exit (1);
- }
- if ((ifreq.ifr_flags & IFF_UP) && (ifr->ifr_addr.sa_family == AF_INET)
- && ((ifreq.ifr_flags & IFF_LOOPBACK) || (loopback == 0)))
- {
- *addr = *((struct sockaddr_in *) &ifr->ifr_addr);
- addr->sin_port = htons (PMAPPORT);
- __close (s);
- return TRUE;
- }
- ifr++;
+ if ((run->ifa_flags & IFF_UP) && run->ifa_addr->sa_family == AF_INET
+ && ((run->ifa_flags & IFF_LOOPBACK) || loopback == 0))
+ {
+ *addr = *((struct sockaddr_in *) run->ifa_addr);
+ addr->sin_port = htons (PMAPPORT);
+ goto out;
+ }
+
+ run = run->ifa_next;
}
+
if (loopback == 1)
{
loopback = 0;
goto again;
}
- __close (s);
- return FALSE;
+ out:
+ freeifaddrs (ifa);
+
+ return run == NULL ? FALSE : TRUE;
}
diff --git a/sunrpc/pmap_rmt.c b/sunrpc/pmap_rmt.c
index c02f546b36..e446f5e608 100644
--- a/sunrpc/pmap_rmt.c
+++ b/sunrpc/pmap_rmt.c
@@ -53,6 +53,7 @@ static char sccsid[] = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";
#undef _POSIX_SOURCE /* Ultrix <sys/param.h> needs --roland@gnu */
#include <sys/param.h> /* Ultrix needs before net/if --roland@gnu */
#include <net/if.h>
+#include <ifaddrs.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#define MAX_BROADCAST_SIZE 1400
@@ -174,55 +175,31 @@ INTDEF(xdr_rmtcallres)
static int
internal_function
-getbroadcastnets (struct in_addr *addrs, int sock, char *buf)
- /* int sock: any valid socket will do */
- /* char *buf: why allocate more when we can use existing... */
+getbroadcastnets (struct in_addr *addrs, int naddrs)
{
- struct ifconf ifc;
- struct ifreq ifreq, *ifr;
- struct sockaddr_in *sin;
- int n, i;
+ struct ifaddrs *ifa;
- ifc.ifc_len = UDPMSGSIZE;
- ifc.ifc_buf = buf;
- if (__ioctl (sock, SIOCGIFCONF, (char *) &ifc) < 0)
+ if (getifaddrs (&ifa) == 0)
{
- perror (_("broadcast: ioctl (get interface configuration)"));
- return (0);
+ perror ("broadcast: getifaddrs");
+ return 0;
}
- ifr = ifc.ifc_req;
- for (i = 0, n = ifc.ifc_len / sizeof (struct ifreq); n > 0; n--, ifr++)
+
+ int i = 0;
+ struct ifaddrs *run = ifa;
+ while (run != NULL && i < naddrs)
{
- ifreq = *ifr;
- if (__ioctl (sock, SIOCGIFFLAGS, (char *) &ifreq) < 0)
- {
- perror (_("broadcast: ioctl (get interface flags)"));
- continue;
- }
- if ((ifreq.ifr_flags & IFF_BROADCAST) &&
- (ifreq.ifr_flags & IFF_UP) &&
- ifr->ifr_addr.sa_family == AF_INET)
- {
- sin = (struct sockaddr_in *) &ifr->ifr_addr;
-#ifdef SIOCGIFBRDADDR /* 4.3BSD */
- if (__ioctl (sock, SIOCGIFBRDADDR, (char *) &ifreq) < 0)
- {
- addrs[i++] = inet_makeaddr (inet_netof
- /* Changed to pass struct instead of s_addr member
- by roland@gnu. */
- (sin->sin_addr), INADDR_ANY);
- }
- else
- {
- addrs[i++] = ((struct sockaddr_in *)
- &ifreq.ifr_addr)->sin_addr;
- }
-#else /* 4.2 BSD */
- addrs[i++] = inet_makeaddr (inet_netof
- (sin->sin_addr.s_addr), INADDR_ANY);
-#endif
- }
+ if ((run->ifa_flags & IFF_BROADCAST) != 0
+ && (run->ifa_flags & IFF_UP) != 0
+ && run->ifa_addr->sa_family == AF_INET)
+ /* Copy the broadcast address. */
+ addrs[i++] = ((struct sockaddr_in *) run->ifa_broadaddr)->sin_addr;
+
+ run = run->ifa_next;
}
+
+ freeifaddrs (ifa);
+
return i;
}
@@ -280,7 +257,7 @@ clnt_broadcast (prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
#endif /* def SO_BROADCAST */
fd.fd = sock;
fd.events = POLLIN;
- nets = getbroadcastnets (addrs, sock, inbuf);
+ nets = getbroadcastnets (addrs, sizeof (addrs) / sizeof (addrs[0]));
__bzero ((char *) &baddr, sizeof (baddr));
baddr.sin_family = AF_INET;
baddr.sin_port = htons (PMAPPORT);
diff --git a/sysdeps/alpha/alphaev6/memcpy.S b/sysdeps/alpha/alphaev6/memcpy.S
index d16bc03a02..7cff521da2 100644
--- a/sysdeps/alpha/alphaev6/memcpy.S
+++ b/sysdeps/alpha/alphaev6/memcpy.S
@@ -39,6 +39,7 @@
.set noat
ENTRY(memcpy)
+ .prologue 0
mov $16, $0 # E : copy dest to return
ble $18, $nomoredata # U : done with the copy?
diff --git a/sysdeps/generic/bits/types.h b/sysdeps/generic/bits/types.h
index 8abea03f57..ce48964f14 100644
--- a/sysdeps/generic/bits/types.h
+++ b/sysdeps/generic/bits/types.h
@@ -1,5 +1,5 @@
/* bits/types.h -- definitions of __*_t types underlying *_t types.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 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
@@ -106,8 +106,8 @@ typedef struct
#define __SLONGWORD_TYPE long int
#define __ULONGWORD_TYPE unsigned long int
#if __WORDSIZE == 32
-# define __SQUAD_TYPE long long int
-# define __UQUAD_TYPE unsigned long long int
+# define __SQUAD_TYPE __quad_t
+# define __UQUAD_TYPE __u_quad_t
# define __SWORD_TYPE int
# define __UWORD_TYPE unsigned int
# define __SLONG32_TYPE long int
diff --git a/sysdeps/generic/s_fdim.c b/sysdeps/generic/s_fdim.c
index 201f93692e..5804e631c3 100644
--- a/sysdeps/generic/s_fdim.c
+++ b/sysdeps/generic/s_fdim.c
@@ -1,5 +1,5 @@
/* Return positive difference between arguments.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -31,7 +31,7 @@ __fdim (double x, double y)
/* Raise invalid flag. */
return x - y;
- return x < y ? 0 : x - y;
+ return x <= y ? 0 : x - y;
}
weak_alias (__fdim, fdim)
#ifdef NO_LONG_DOUBLE
diff --git a/sysdeps/generic/s_fdimf.c b/sysdeps/generic/s_fdimf.c
index 64d54b7fe4..2f3ce303ae 100644
--- a/sysdeps/generic/s_fdimf.c
+++ b/sysdeps/generic/s_fdimf.c
@@ -1,5 +1,5 @@
/* Return positive difference between arguments.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -31,6 +31,6 @@ __fdimf (float x, float y)
/* Raise invalid flag. */
return x - y;
- return x < y ? 0 : x - y;
+ return x <= y ? 0 : x - y;
}
weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/generic/s_fdiml.c b/sysdeps/generic/s_fdiml.c
index 83049ae732..70246bafbd 100644
--- a/sysdeps/generic/s_fdiml.c
+++ b/sysdeps/generic/s_fdiml.c
@@ -1,5 +1,5 @@
/* Return positive difference between arguments.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -31,6 +31,6 @@ __fdiml (long double x, long double y)
/* Raise invalid flag. */
return x - y;
- return x < y ? 0 : x - y;
+ return x <= y ? 0 : x - y;
}
weak_alias (__fdiml, fdiml)
diff --git a/sysdeps/i386/i686/fpu/s_fdim.S b/sysdeps/i386/i686/fpu/s_fdim.S
index e610973a56..30ecff4e7c 100644
--- a/sysdeps/i386/i686/fpu/s_fdim.S
+++ b/sysdeps/i386/i686/fpu/s_fdim.S
@@ -1,5 +1,5 @@
/* Compute positive difference.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -28,12 +28,14 @@ ENTRY(__fdim)
fucomi %st(1), %st
jp 1f
- fsubrp %st, %st(1)
+ jc 3f
+ fstp %st(1)
fldz
- fcomi %st(1), %st
- fcmovb %st(1), %st
jmp 2f
+3: fsubrp %st, %st(1)
+ ret
+
1: fucomi %st(0), %st
fcmovnu %st(1), %st
2: fstp %st(1)
diff --git a/sysdeps/i386/i686/fpu/s_fdimf.S b/sysdeps/i386/i686/fpu/s_fdimf.S
index a22cbe9d66..888df14b6f 100644
--- a/sysdeps/i386/i686/fpu/s_fdimf.S
+++ b/sysdeps/i386/i686/fpu/s_fdimf.S
@@ -1,5 +1,5 @@
/* Compute positive difference.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -28,12 +28,14 @@ ENTRY(__fdimf)
fucomi %st(1), %st
jp 1f
- fsubrp %st, %st(1)
+ jc 3f
+ fstp %st(1)
fldz
- fcomi %st(1), %st
- fcmovb %st(1), %st
jmp 2f
+3: fsubrp %st, %st(1)
+ ret
+
1: fucomi %st(0), %st
fcmovnu %st(1), %st
2: fstp %st(1)
diff --git a/sysdeps/i386/i686/fpu/s_fdiml.S b/sysdeps/i386/i686/fpu/s_fdiml.S
index fa3c51e462..cb0e26e367 100644
--- a/sysdeps/i386/i686/fpu/s_fdiml.S
+++ b/sysdeps/i386/i686/fpu/s_fdiml.S
@@ -1,5 +1,5 @@
/* Compute positive difference.
- Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -28,12 +28,14 @@ ENTRY(__fdiml)
fucomi %st(1), %st
jp 1f
- fsubrp %st, %st(1)
+ jc 3f
+ fstp %st(1)
fldz
- fcomi %st(1), %st
- fcmovb %st(1), %st
jmp 2f
+3: fsubrp %st, %st(1)
+ ret
+
1: fucomi %st(0), %st
fcmovnu %st(1), %st
2: fstp %st(1)
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 225c1a1088..20e60de393 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -445,12 +445,35 @@ gaih_inet (const char *name, const struct gaih_service *service,
}
else
{
- st = __alloca (sizeof (struct gaih_servtuple));
- st->next = NULL;
- st->socktype = tp->socktype;
- st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY)
- ? req->ai_protocol : tp->protocol);
- st->port = htons (service->num);
+ if (req->ai_socktype || req->ai_protocol)
+ {
+ st = __alloca (sizeof (struct gaih_servtuple));
+ st->next = NULL;
+ st->socktype = tp->socktype;
+ st->protocol = ((tp->protoflag & GAI_PROTO_PROTOANY)
+ ? req->ai_protocol : tp->protocol);
+ st->port = htons (service->num);
+ }
+ else
+ {
+ /* Neither socket type nor protocol is set. Return all
+ socket types we know about. */
+ struct gaih_servtuple **lastp = &st;
+ for (tp = gaih_inet_typeproto + 1; tp->name[0]; ++tp)
+ if ((tp->protoflag & GAI_PROTO_NOSERVICE) == 0)
+ {
+ struct gaih_servtuple *newp;
+
+ newp = __alloca (sizeof (struct gaih_servtuple));
+ newp->next = NULL;
+ newp->socktype = tp->socktype;
+ newp->protocol = tp->protocol;
+ newp->port = htons (service->num);
+
+ *lastp = newp;
+ lastp = &newp->next;
+ }
+ }
}
}
else if (req->ai_socktype || req->ai_protocol)
@@ -1493,11 +1516,7 @@ getaddrinfo (const char *name, const char *service,
gaih_service.num = -1;
}
- else
- /* Can't specify a numerical socket unless a protocol family was
- given. */
- if (hints->ai_socktype == 0 && hints->ai_protocol == 0)
- return EAI_SERVICE;
+
pservice = &gaih_service;
}
else
diff --git a/sysdeps/powerpc/fpu/s_fdim.c b/sysdeps/powerpc/fpu/s_fdim.c
index 165e2ff5a5..2b767addab 100644
--- a/sysdeps/powerpc/fpu/s_fdim.c
+++ b/sysdeps/powerpc/fpu/s_fdim.c
@@ -1,5 +1,5 @@
/* Return positive difference between arguments.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004 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
@@ -22,7 +22,7 @@
double
__fdim (double x, double y)
{
- return x < y ? 0 : x - y;
+ return x <= y ? 0 : x - y;
}
weak_alias (__fdim, fdim)
#ifdef NO_LONG_DOUBLE
diff --git a/sysdeps/powerpc/fpu/s_fdimf.c b/sysdeps/powerpc/fpu/s_fdimf.c
index 997ec8983f..a27c1e4039 100644
--- a/sysdeps/powerpc/fpu/s_fdimf.c
+++ b/sysdeps/powerpc/fpu/s_fdimf.c
@@ -1,5 +1,5 @@
/* Return positive difference between arguments.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2004 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
@@ -22,6 +22,6 @@
float
__fdimf (float x, float y)
{
- return x < y ? 0 : x - y;
+ return x <= y ? 0 : x - y;
}
weak_alias (__fdimf, fdimf)
diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h
index 5378f81602..5259c09a91 100644
--- a/sysdeps/unix/alpha/sysdep.h
+++ b/sysdeps/unix/alpha/sysdep.h
@@ -43,14 +43,14 @@
#define LEAF(name, framesize) \
.globl name; \
- .align 3; \
+ .align 4; \
.ent name, 0; \
__LABEL(name) \
.frame sp, framesize, ra
#define ENTRY(name) \
.globl name; \
- .align 3; \
+ .align 4; \
.ent name, 0; \
__LABEL(name) \
.frame sp, 0, ra
diff --git a/sysdeps/x86_64/fpu/s_fdiml.S b/sysdeps/x86_64/fpu/s_fdiml.S
index 3460b0f979..d63ca00ef1 100644
--- a/sysdeps/x86_64/fpu/s_fdiml.S
+++ b/sysdeps/x86_64/fpu/s_fdiml.S
@@ -1,5 +1,5 @@
/* Compute positive difference.
- Copyright (C) 1997, 1998, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2002, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -28,12 +28,14 @@ ENTRY(__fdiml)
fucomi %st(1), %st
jp 1f
- fsubrp %st, %st(1)
+ jc 3f
+ fstp %st(1)
fldz
- fcomi %st(1), %st
- fcmovb %st(1), %st
jmp 2f
+3: fsubrp %st, %st(1)
+ ret
+
1: fucomi %st(0), %st
fcmovnu %st(1), %st
2: fstp %st(1)