]> 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>
Thu, 23 Aug 2018 20:28:45 +0000 (22:28 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/lxccontainer.c

index 194ad9f18f478ea18a946001d5fdd5467138a8f9..973885610ff11562e435cb8290efab2cf2947a10 100644 (file)
@@ -657,13 +657,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, "."))
@@ -671,10 +669,12 @@ static bool am_single_threaded(void)
 
                if (!strcmp(direntp->d_name, ".."))
                        continue;
+
                if (++count > 1)
                        break;
        }
        closedir(dir);
+
        return count == 1;
 }