patches/glibc/2.7/250-sh-chop-linux-version.patch
author "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
Mon Apr 16 15:25:36 2012 +0200 (2012-04-16)
changeset 2941 13e40098fffc
permissions -rw-r--r--
cc/gcc: update Linaro GCC revisions to 2012.04

Update Linaro GCC with the latest available revisions.

The 4.7 revision is also released, but the infrastructure is not yet ready for
it in CT-NG.

Signed-off-by: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.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;