Signed-off-by: Wanlong Gao <[email protected]>
---
include/test.h | 2 +-
lib/tst_kvercmp.c | 23 ++++++++++++++---------
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/include/test.h b/include/test.h
index a76fafc..57d784e 100644
--- a/include/test.h
+++ b/include/test.h
@@ -178,7 +178,7 @@ struct tst_kern_exv {
char *extra_ver;
};
-int tst_kvercmp2(int r1, int r2, int r3, struct tst_kern_exv *vers);
+int tst_kvercmp2(struct tst_kern_exv *vers);
/* lib/tst_is_cwd.c */
int tst_is_cwd_nfs(void);
diff --git a/lib/tst_kvercmp.c b/lib/tst_kvercmp.c
index 15fb571..b532771 100644
--- a/lib/tst_kvercmp.c
+++ b/lib/tst_kvercmp.c
@@ -67,18 +67,26 @@ int tst_kvercmp(int r1, int r2, int r3)
static int tst_kexvcmp(char *tst_exv, char *cur_ver)
{
- int c1 = 0, c2 = 0, t1 = 0, t2 = 0;
+ int c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = 0;
+ int t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0;
int ret;
- sscanf(cur_ver, "%*d.%*d.%*d-%d.%d", &c1, &c2);
- sscanf(tst_exv, "%d.%d", &t1, &t2);
+ sscanf(cur_ver, "%d.%d.%d-%d.%d", &c1, &c2, &c3, &c4, &c5);
+ sscanf(tst_exv, "%d.%d.%d-%d.%d", &t1, &t2, &t3, &t4, &t5);
+
if ((ret = c1 - t1))
return ret;
- else
- return c2 - t2;
+ if ((ret = c2 - t2))
+ return ret;
+ if ((ret = c3 - t3))
+ return ret;
+ if ((ret = c4 - t4))
+ return ret;
+
+ return c5 - t5;
}
-int tst_kvercmp2(int r1, int r2, int r3, struct tst_kern_exv *vers)
+int tst_kvercmp2(struct tst_kern_exv *vers)
{
int ret;
int i;
@@ -86,9 +94,6 @@ int tst_kvercmp2(int r1, int r2, int r3, struct tst_kern_exv
*vers)
char *kver;
const char *cur_dist_name = NULL;
- if ((ret = tst_kvercmp(r1, r2, r3)))
- return ret;
-
uname(&uval);
kver = uval.release;
if (strstr(kver, ".el5")) {
--
1.8.3.2.634.g7a3187e
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list