lxccontainer: am_single_threaded()

parent e202dfb8
......@@ -684,13 +684,11 @@ static bool am_single_threaded(void)
{
struct dirent *direntp;
DIR *dir;
int count=0;
int count = 0;
dir = opendir("/proc/self/task");
if (!dir) {
INFO("failed to open /proc/self/task");
if (!dir)
return false;
}
while ((direntp = readdir(dir))) {
if (!strcmp(direntp->d_name, "."))
......@@ -698,10 +696,12 @@ static bool am_single_threaded(void)
if (!strcmp(direntp->d_name, ".."))
continue;
if (++count > 1)
break;
}
closedir(dir);
return count == 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment