]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20040927T0611 cvs/fedora-glibc-2_3_3-59
authorJakub Jelinek <jakub@redhat.com>
Mon, 27 Sep 2004 06:18:18 +0000 (06:18 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 27 Sep 2004 06:18:18 +0000 (06:18 +0000)
26 files changed:
ChangeLog
elf/dl-support.c
elf/readlib.c
fedora/branch.mk
fedora/glibc.spec.in
math/libm-test.inc
posix/Makefile
posix/tst-getaddrinfo2.c [new file with mode: 0644]
scripts/test-installation.pl
sunrpc/clnt_udp.c
sunrpc/get_myaddr.c
sunrpc/pmap_clnt.c
sunrpc/pmap_rmt.c
sysdeps/alpha/alphaev6/memcpy.S
sysdeps/generic/bits/types.h
sysdeps/generic/s_fdim.c
sysdeps/generic/s_fdimf.c
sysdeps/generic/s_fdiml.c
sysdeps/i386/i686/fpu/s_fdim.S
sysdeps/i386/i686/fpu/s_fdimf.S
sysdeps/i386/i686/fpu/s_fdiml.S
sysdeps/posix/getaddrinfo.c
sysdeps/powerpc/fpu/s_fdim.c
sysdeps/powerpc/fpu/s_fdimf.c
sysdeps/unix/alpha/sysdep.h
sysdeps/x86_64/fpu/s_fdiml.S

index b92394eb40c28b67ebca54cc8c1ab69c9f01d50b..d208b771e99147490b9568a00c9e0f0b4d934f32 100644 (file)
--- 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
        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>
 
index e3df749ae5239c1693c8bf0a9ca143c7be3bd65e..8bf6814de2a192b4ca68df47a2e5c8fd92f04fb7 100644 (file)
@@ -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
index a1fec9458937e2722472bad702db56fed798a19a..4fbc3e5e4c8adcba00ccd1656a464cae5d922817 100644 (file)
@@ -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;
     }
index 46ec6e506daf4c98c35e81ac8635e5ee24cb9916..7a862eaf517dc338e3d3b201af91644ef96843fe 100644 (file)
@@ -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
index b2cb49a67fdeefb3857b50b60d722c5cf8f65ebf..35e9dc74bde74ee3b867c4fbdba7a1b288511263 100644 (file)
@@ -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)
index 729fce936993073b69bf0926f01630a3b362115c..b23ec8430fe6d9e31bfd18a7fed9e89374cd889e 100644 (file)
@@ -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);
 }
 
index 766c1dd7f724ce2bbc3c600703117f1e43ce9f5c..82d35378d1bac383bc52ec8ab0c42ef13045846c 100644 (file)
@@ -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 (file)
index 0000000..b0bce59
--- /dev/null
@@ -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"
index 981c2ccada31c874a351bccae27fd7a822e511ae..90cd9d754713907a0d1a699cc3d56e05f37a5941 100755 (executable)
@@ -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";
index f906173363bc974fb0a4363382397a52e92f008e..1836ff3433f2ff0b5ba35e2881d82feb26cef658 100644 (file)
@@ -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
index 7a4bb8cb6fd891fe062ba164f35132b8694e1e7f..ee822970f9e07b3987a5fe5bdf9ef25bf1ad546f 100644 (file)
@@ -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...  */
 }
index d88487d8f40ff546dfb302b4c7b51cb8f1f9960d..c968511e96232de205919b488019048c111a02db 100644 (file)
@@ -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>
 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;
 }
 
 
index c02f546b368c73f88b25016d8b7888772863e9c3..e446f5e6089e99567f21dcf034ed3576c1046a16 100644 (file)
@@ -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);
index d16bc03a02642441c7131e4920ceab85b5855c71..7cff521da20c24e68ca5a047d9d7f63c190ba7e0 100644 (file)
@@ -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?
index 8abea03f5708b65b9b635909ef3123460fbc2d5a..ce48964f147303ac0aa674ed37ce47418333b561 100644 (file)
@@ -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
index 201f93692ec6de3a399468e27792b7dc1787129d..5804e631c376f83bb84d5dba0a7bd34adee463d2 100644 (file)
@@ -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
index 64d54b7fe4c30ee3cc066e1c64c5d1b2b2a58325..2f3ce303ae869b6c0b093402fd9065039cfd5bb0 100644 (file)
@@ -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)
index 83049ae732d89dcdcf80e83806f1a7cf6efced95..70246bafbdb66f2253f03f4c1230226133957aa6 100644 (file)
@@ -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)
index e610973a566063eda9ce939598d9dcb20d302f8c..30ecff4e7c4226d3aa957dec06b813f21dc37ff5 100644 (file)
@@ -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)
index a22cbe9d6634e6570653023816f1f6f4153012c2..888df14b6f1f810e7bbd9b53823403c27e4acb0a 100644 (file)
@@ -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)
index fa3c51e4626272c4c6a4c7dd755f4540fada1071..cb0e26e36771434a856ed449b75dc6f006b5b446 100644 (file)
@@ -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)
index 225c1a108864763831aaeb800ce44e7e8300fecc..20e60de39337f56242698d1dd3343c21dd21786f 100644 (file)
@@ -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
index 165e2ff5a5c218abad8f70cc452e3b7b2e737b78..2b767addabe4e7a730824a34b33987ad79b9cf1b 100644 (file)
@@ -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
index 997ec8983f33a4dac13378f49987027e0514c015..a27c1e4039ffdd0690bb5e0a9d509042942bf1b5 100644 (file)
@@ -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)
index 5378f8160274a4e8e381c104358031ec1f2e3eba..5259c09a911caef2a6d14f0ccecf8f5ff611fc28 100644 (file)
 
 #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
index 3460b0f979edfb7e53845597ee63143a6d9a1803..d63ca00ef1837fd057814b4b248a10ee00e1d27d 100644 (file)
@@ -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)