[PATCH] mdadm: Linux 3.x version change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux