Thread (4 messages) 4 messages, 4 authors, 2011-06-17

[PATCH] mdadm: Linux 3.x version change

flat view
STALE5593d

From: Namhyung Kim <hidden>
Date: 2011-06-10 14:30:00
Subsystem: the rest · Maintainer: Linus Torvalds

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

Signed-off-by: Namhyung Kim <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help