]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxccontainer: am_single_threaded()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 24 Feb 2018 14:22:38 +0000 (15:22 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 24 Feb 2018 20:38:30 +0000 (21:38 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lxccontainer.c

index 6423d95ab9c5ac2049bedf51fb698e9aedc36d9a..f114999bf84435502eeb8b2fbb55a9ee987cbfc1 100644 (file)
@@ -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;
 }