linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mdadm: Linux 3.x version change
@ 2011-06-10 14:30 Namhyung Kim
  2011-06-17 12:18 ` Milan Broz
  2011-06-17 14:07 ` David Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Namhyung Kim @ 2011-06-10 14:30 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

As Linux 3.x changes its versioning scheme, we have to deal with
the 2-digit version number also.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 util.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/util.c b/util.c
index e92be4f..9db9ee6 100644
--- a/util.c
+++ b/util.c
@@ -154,8 +154,15 @@ int get_linux_version()
 	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);
+	/* deal with 3.x version change */
+	if (*cp != '.') {
+		if (a >= 3)
+			c = 0;
+		else
+			return -1;
+	} else {
+		c = strtoul(cp+1, NULL, 10);
+	}
 
 	return (a*1000000)+(b*1000)+c;
 }
-- 
1.7.5.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-17 14:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10 14:30 [PATCH] mdadm: Linux 3.x version change Namhyung Kim
2011-06-17 12:18 ` Milan Broz
2011-06-17 12:54   ` NeilBrown
2011-06-17 14:07 ` David Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).