patches/glibc/2.7/250-sh-chop-linux-version.patch
author Arnaud Lacombe <lacombar@gmail.com>
Thu Aug 05 17:59:51 2010 +0200 (2010-08-05)
changeset 2069 366bd2b22675
permissions -rw-r--r--
complibs/mpc: fix MPC 0.8.1 build with MPFR 3.0.0

This is the change introduced by revision 734 of MPC repository.

Author: Paul Zimmermann <Paul.Zimmermann@loria.fr>
Revision log: [acos.c] fixed problem with GMP_RNDA (should be MPFR_RNDA, and code was wrong)

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
     1 --- glibc-2.7/sysdeps/unix/sysv/linux/dl-osinfo.h.orig	2007-09-15 23:54:08.000000000 +0100
     2 +++ glibc-2.7/sysdeps/unix/sysv/linux/dl-osinfo.h	2008-08-20 09:26:26.000000000 +0100
     3 @@ -83,6 +83,10 @@
     4    int parts;
     5    char *cp;
     6    struct utsname uts;
     7 +  int dotsfound = 0;
     8 +  int versionindex = 0;
     9 +  char *choppoint;
    10 +
    11  
    12    /* Try the uname system call.  */
    13    if (__uname (&uts))
    14 @@ -102,8 +106,34 @@
    15    else
    16      buf = uts.release;
    17  
    18 +  /* We are only interested in the first three kernel numbers, so */
    19 +  /* chop off anything past that: */
    20 +
    21 +  choppoint = buf;
    22 +  while (1)
    23 +    {
    24 +      versionindex++;
    25 +      if (versionindex == 63) break;
    26 +      if (*choppoint == '.') dotsfound++;
    27 +      choppoint++;
    28 +      if (dotsfound == 2)
    29 +      {
    30 +        if (*choppoint == '0' || *choppoint == '1'
    31 +          || *choppoint == '2' || *choppoint == '3'
    32 +          || *choppoint == '4' || *choppoint == '5'
    33 +          || *choppoint == '6' || *choppoint == '7'
    34 +          || *choppoint == '8' || *choppoint == '9')
    35 +          continue;
    36 +        else
    37 +          {
    38 +            *choppoint = 0;
    39 +            break;
    40 +          }
    41 +      }
    42 +    }
    43 +
    44    /* Now convert it into a number.  The string consists of at most
    45 -     three parts.  */
    46 +     three parts.  Now it does, anyway.  ;-)  */
    47    version = 0;
    48    parts = 0;
    49    cp = buf;