From: yangsheng Date: Mon, 18 Aug 2008 05:33:56 +0000 (+0000) Subject: Branch b1_8_gate X-Git-Tag: v1_7_100~1^387~1 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=adae00757290d7ab93939429b6df026ba1e7b29a;p=fs%2Flustre-release.git Branch b1_8_gate b=16283 i=adilger, sheng.yang Handle the new option for rhel5 /proc/mounts. --- diff --git a/lnet/utils/debug.c b/lnet/utils/debug.c index 9f9726d..6800039 100644 --- a/lnet/utils/debug.c +++ b/lnet/utils/debug.c @@ -861,9 +861,8 @@ static int jt_dbg_modules_2_5(int argc, char **argv) char *path = ""; char *kernel = "linux"; const char *proc = "/proc/modules"; - char modname[128], others[4096]; + char modname[128], buf[4096]; long modaddr; - int rc; FILE *file; if (argc >= 2) @@ -881,15 +880,17 @@ static int jt_dbg_modules_2_5(int argc, char **argv) return 0; } - while ((rc = fscanf(file, "%s %s %s %s %s %lx\n", - modname, others, others, others, others, &modaddr)) == 6) { - for (mp = mod_paths; mp->name != NULL; mp++) { - if (!strcmp(mp->name, modname)) - break; - } - if (mp->name) { - printf("add-symbol-file %s%s%s/%s.o 0x%0lx\n", path, - path[0] ? "/" : "", mp->path, mp->name, modaddr); + while (fgets(buf, sizeof(buf), file) != NULL) { + if (sscanf(buf, "%s %*s %*s %*s %*s %lx", modname, &modaddr) == 2) { + for (mp = mod_paths; mp->name != NULL; mp++) { + if (!strcmp(mp->name, modname)) + break; + } + if (mp->name) { + printf("add-symbol-file %s%s%s/%s.o 0x%0lx\n", + path, path[0] ? "/" : "", + mp->path, mp->name, modaddr); + } } }