[xdm PATCH 1/3] Don't remove the pid file from xdm child processes

Julien Cristau jcristau at debian.org
Tue Mar 23 11:40:48 PDT 2010


The parent xdm process registers RemovePid with atexit(), which means
that any child exit would trigger the (wrong) removal of the pidfile.
So in RemovePid, don't do anything if we're not the parent xdm process.

Signed-off-by: Julien Cristau <jcristau at debian.org>
---
 dm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dm.c b/dm.c
index 55fb24e..da18800 100644
--- a/dm.c
+++ b/dm.c
@@ -969,6 +969,9 @@ StorePid (void)
 static void
 RemovePid (void)
 {
+    if (parent_pid != getpid())
+	return;
+
     Debug ("unlinking process ID file %s\n", pidFile);
     if (unlink (pidFile))
 	if (errno != ENOENT)
-- 
1.7.0



More information about the xorg-devel mailing list