diff options
author | Bor Kraljič | 2011-10-05 15:26:24 +0200 |
---|---|---|
committer | Vlad Glagolev | 2011-10-10 17:55:35 +0400 |
commit | c14a055bb127dd1c72c0b628ae680994877a48d0 (patch) | |
tree | 8505f7e1608420043ba44ac38816cff9af536263 | |
parent | e5c42b74f129bb329564fbb91f0ae37be7da500d (diff) |
mdadm: added upstream patch for kernel 3.0 support (issue #230)
(cherry picked from commit b261ceccb4eaa5730f785bceb643528ccea467eb)
-rw-r--r-- | disk/mdadm/HISTORY | 3 | ||||
-rwxr-xr-x | disk/mdadm/PRE_BUILD | 3 | ||||
-rw-r--r-- | disk/mdadm/linux-3.0.patch | 45 |
3 files changed, 50 insertions, 1 deletions
diff --git a/disk/mdadm/HISTORY b/disk/mdadm/HISTORY index d4ce62d2c8..84e72fe43c 100644 --- a/disk/mdadm/HISTORY +++ b/disk/mdadm/HISTORY @@ -1,3 +1,6 @@ +2011-10-05 Bor Kraljič <pyrobor@ver.si> + * linux-3.0.patch: added upstream patch for kernel 3.0 support (issue #230) + 2011-03-30 Florian Franzmann <siflfran@hawo.stw.uni-erlangen.de> * PRE_BUILD: remove compiler warnings/errors to fix build with gcc 4.6 diff --git a/disk/mdadm/PRE_BUILD b/disk/mdadm/PRE_BUILD index 1dc347999b..c4886fd106 100755 --- a/disk/mdadm/PRE_BUILD +++ b/disk/mdadm/PRE_BUILD @@ -2,4 +2,5 @@ default_pre_build && cd ${SOURCE_DIRECTORY} && sedit 's:-Wall::' Makefile && sedit 's:-Wextra::' Makefile && -sedit 's:-Werror::' Makefile +sedit 's:-Werror::' Makefile && +patch -p1 -d $SOURCE_DIRECTORY < $SPELL_DIRECTORY/linux-3.0.patch diff --git a/disk/mdadm/linux-3.0.patch b/disk/mdadm/linux-3.0.patch new file mode 100644 index 0000000000..b8111b6617 --- /dev/null +++ b/disk/mdadm/linux-3.0.patch @@ -0,0 +1,45 @@ +From f161d047eed634b3380262767f955eb888502e88 Mon Sep 17 00:00:00 2001 +From: NeilBrown <neilb@suse.de> +Date: Fri, 17 Jun 2011 22:49:24 +1000 +Subject: [PATCH] util: correctly parse shorter linux version numbers. + +The next version of Linux might be 3.0. If it is, get_linux_version +will fail. +So make it more robust. + +Reported-by: Namhyung Kim <namhyung@gmail.com> +Reported-by: Milan Broz <mbroz@redhat.com> +Signed-off-by: NeilBrown <neilb@suse.de> +--- + util.c | 10 +++++----- + 1 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/util.c b/util.c +index 10bbe56..55d171a 100644 +--- a/util.c ++++ b/util.c +@@ -146,16 +146,16 @@ int get_linux_version() + { + struct utsname name; + char *cp; +- int a,b,c; ++ int a = 0, b = 0,c = 0; + if (uname(&name) <0) + return -1; + + cp = name.release; + a = strtoul(cp, &cp, 10); +- if (*cp != '.') return -1; +- b = strtoul(cp+1, &cp, 10); +- if (*cp != '.') return -1; +- c = strtoul(cp+1, NULL, 10); ++ if (*cp == '.') ++ b = strtoul(cp+1, &cp, 10); ++ if (*cp == '.') ++ c = strtoul(cp+1, &cp, 10); + + return (a*1000000)+(b*1000)+c; + } +-- +1.7.6.3 + |