diff options
author | Lans Zhang <jia.zhang@windriver.com> | 2013-01-16 09:24:14 +0800 |
---|---|---|
committer | Chen, Gong <gong.chen@linux.intel.com> | 2015-01-21 21:24:00 -0500 |
commit | 64dfd147d1898116c42663999ca946cdd466d2fd (patch) | |
tree | 10f398383220146ef8734b37d8630842bc7e1bd4 | |
parent | 5b46f71f60dbeff90188d6bb146feede41d679f2 (diff) | |
download | mce-test-64dfd147d1898116c42663999ca946cdd466d2fd.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; } |