diff options
author | Lans Zhang <jia.zhang@windriver.com> | 2013-01-16 09:24:14 +0800 |
---|---|---|
committer | Chen Gong <gong.chen@linux.intel.com> | 2013-01-18 08:36:13 -0500 |
commit | 680273b3ebab08a4b8f5724f75cf51ffd0127626 (patch) | |
tree | 10f398383220146ef8734b37d8630842bc7e1bd4 | |
parent | c937c1eb17b17894e163d4b8deaae4851b6b2b2d (diff) | |
download | mce-test-680273b3ebab08a4b8f5724f75cf51ffd0127626.tar.gz |
Fix hugetlbfs mount path detection
The type parameter in mount entry is random especially for pseudo
filesystem, thus, we don't want a hardcode on it.
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
-rw-r--r-- | cases/function/hwpoison/hugepage.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cases/function/hwpoison/hugepage.h b/cases/function/hwpoison/hugepage.h index ba5bb34..0ba9aad 100644 --- a/cases/function/hwpoison/hugepage.h +++ b/cases/function/hwpoison/hugepage.h @@ -70,9 +70,10 @@ int hugetlbfs_root(char *dir) char *line = NULL; size_t linelen = 0; char dummy[100]; + char type[100]; while (getline(&line, &linelen, f) > 0) { - if (sscanf(line, "none %s hugetlbfs %[^ ]", - dir, dummy) >= 2) { + if (sscanf(line, "%s %s hugetlbfs %[^ ]", + type, dir, dummy) >= 3) { found = 1; break; } |