From 31d9654b479c960187ab6cdf87b5db3a92a990af Mon Sep 17 00:00:00 2001 From: Tuukka Tikkanen Date: Wed, 28 Jan 2015 16:28:45 +0200 Subject: 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 Signed-off-by: Amit Kucheria --- topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- cgit v1.2.3