Merge pull request #178 from hejingxian123/commit
Add return value check of opendir in do_one_cpu
This commit is contained in:
commit
7ec539331d
|
@ -366,7 +366,7 @@ static void do_one_cpu(char *path)
|
|||
struct topo_obj *node;
|
||||
|
||||
dir = opendir(path);
|
||||
do {
|
||||
while (dir) {
|
||||
entry = readdir(dir);
|
||||
if (!entry)
|
||||
break;
|
||||
|
@ -379,8 +379,9 @@ static void do_one_cpu(char *path)
|
|||
break;
|
||||
}
|
||||
}
|
||||
} while (entry);
|
||||
closedir(dir);
|
||||
}
|
||||
if (dir)
|
||||
closedir(dir);
|
||||
|
||||
/*
|
||||
* In case of multiple NUMA nodes within a CPU package,
|
||||
|
|
Loading…
Reference in a new issue