[Libreoffice-commits] online.git: common/Util.cpp

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Mon Jan 20 21:05:03 UTC 2020


 common/Util.cpp |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 09bb16ad78f71e285b6059774ce089b9ef1d006b
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Mon Jan 20 19:33:00 2020 +0000
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Jan 20 22:04:40 2020 +0100

    util: for process thread count - ignore '.' and '..' in /proc/self/tasks
    
    Change-Id: Ieec6eaac475b4e318578cfc0d93c36e2395e6f19
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87097
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/common/Util.cpp b/common/Util.cpp
index 4dc0bdadf..0b3e8cbae 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -188,8 +188,12 @@ namespace Util
             return -1;
         }
         int tasks = 0;
-        while (readdir(fdDir))
-            tasks++;
+        struct dirent *i;
+        while ((i = readdir(fdDir)))
+        {
+            if (i->d_name[0] != '.')
+                tasks++;
+        }
         closedir(fdDir);
         return tasks;
     }


More information about the Libreoffice-commits mailing list