Skip to content

Commit

Permalink
lxccontainer: am_single_threaded()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Aug 23, 2018
1 parent a92d5fa commit 1d2d8eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lxc/lxccontainer.c
Expand Up @@ -657,24 +657,24 @@ 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, "."))
continue;

if (!strcmp(direntp->d_name, ".."))
continue;

if (++count > 1)
break;
}
closedir(dir);

return count == 1;
}

Expand Down

0 comments on commit 1d2d8eb

Please sign in to comment.