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;
|
struct topo_obj *node;
|
||||||
|
|
||||||
dir = opendir(path);
|
dir = opendir(path);
|
||||||
do {
|
while (dir) {
|
||||||
entry = readdir(dir);
|
entry = readdir(dir);
|
||||||
if (!entry)
|
if (!entry)
|
||||||
break;
|
break;
|
||||||
|
@ -379,7 +379,8 @@ static void do_one_cpu(char *path)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (entry);
|
}
|
||||||
|
if (dir)
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue