[Libreoffice-commits] .: sal/osl

Tor Lillqvist tml at kemper.freedesktop.org
Wed Dec 7 00:40:00 PST 2011


 sal/osl/unx/system.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 8538a096603341d78e7c104dacf3048ad7fb953b
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Tue Dec 6 19:49:34 2011 +0100

    Don't replace getpid on Linux when the system version is correct

diff --git a/sal/osl/unx/system.c b/sal/osl/unx/system.c
index 478fdaf..d1fc724 100644
--- a/sal/osl/unx/system.c
+++ b/sal/osl/unx/system.c
@@ -201,14 +201,16 @@ int macxp_resolveAlias(char *path, int buflen)
 
 #endif /* NO_PTHREAD_RTL */
 
-#if defined(LINUX)
-/* The linux kernel thread implemention, always return the pid of the
-   thread subprocess and not of the main process. So we save the main
-   pid at startup
+#if defined(LINUX) && defined (__GLIBC__) && __GLIBC__ == 2 || __GLIBC_MINOR__ < 4
+/* The linux kernel 2.4 getpid implemention always return the pid of the
+   thread subprocess and not of the main process, the NPTL implementation
+   with a Linux kernel 2.6 kernel return the pid. So when possibly
+   their is the wrong implementation of getpid, we save the pid at startup.
    FIXME: when our Linux base-line is above:
-        + Linux kernel version 2.6.18 or higher; -> clone() for NTPL
-        + glibc2 version 2.5 or higher; -> NPTL
+        + Linux kernel version 2.6 or higher; -> clone() for NTPL
+        + glibc2 version 2.4 or higher; -> No longer LinuxThreads, only NPTL
    Then we get a working getpid() and can remove this hack.
+   FIXME: getppid is also wrong in this situation
 */
 
 // Directly from libc.so.6, obviously missing from some unistd.h:


More information about the Libreoffice-commits mailing list