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

New commits:
commit 7091f57b358fd06a236b96cc91990251bba8ea6e
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Mon Jan 20 19:33:00 2020 +0000
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Fri Feb 14 23:33:38 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 <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Michael Meeks <michael.me...@collabora.com>
    (cherry picked from commit 09bb16ad78f71e285b6059774ce089b9ef1d006b)
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87110

diff --git a/common/Util.cpp b/common/Util.cpp
index 2a0151615..253c4a35e 100644
--- a/common/Util.cpp
+++ b/common/Util.cpp
@@ -157,8 +157,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;
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to