aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuukka Tikkanen <idlestat@tic0.net>2015-01-28 16:28:45 +0200
committerAmit Kucheria <amit.kucheria@linaro.org>2015-03-10 02:14:00 +0530
commit31d9654b479c960187ab6cdf87b5db3a92a990af (patch)
tree91291021fa2865f4fcd79864e951509f56b3c658
parent9a52262bf2fe8290c860f13b00c56128de5a5283 (diff)
Topology: Match cpu names only if they begin with "cpu"
Previously any directory entry in /sys/devices/system/cpu/ with the substring "cpu" within the name would be considered to be a subdirectory for a cpu. The substring should begin the name, not just appear within the name. Signed-off-by: Tuukka Tikkanen <idlestat@tic0.net> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
-rw-r--r--topology.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/topology.c b/topology.c
index ff0b6fb..c7528af 100644
--- a/topology.c
+++ b/topology.c
@@ -333,7 +333,7 @@ static struct cpu_topology *topo_folder_scan(char *path, folder_filter_t filter)
if (filter && filter(direntp->d_name))
continue;
- if (!strstr(direntp->d_name, "cpu"))
+ if (strncmp(direntp->d_name, "cpu", 3))
continue;
ret = asprintf(&newpath, "%s/%s/%s", basedir,