lxccontainer: am_single_threaded()

parent e202dfb8
...@@ -684,13 +684,11 @@ static bool am_single_threaded(void) ...@@ -684,13 +684,11 @@ static bool am_single_threaded(void)
{ {
struct dirent *direntp; struct dirent *direntp;
DIR *dir; DIR *dir;
int count=0; int count = 0;
dir = opendir("/proc/self/task"); dir = opendir("/proc/self/task");
if (!dir) { if (!dir)
INFO("failed to open /proc/self/task");
return false; return false;
}
while ((direntp = readdir(dir))) { while ((direntp = readdir(dir))) {
if (!strcmp(direntp->d_name, ".")) if (!strcmp(direntp->d_name, "."))
...@@ -698,10 +696,12 @@ static bool am_single_threaded(void) ...@@ -698,10 +696,12 @@ static bool am_single_threaded(void)
if (!strcmp(direntp->d_name, "..")) if (!strcmp(direntp->d_name, ".."))
continue; continue;
if (++count > 1) if (++count > 1)
break; break;
} }
closedir(dir); closedir(dir);
return count == 1; 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