summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdiel Janulgue <abdiel.janulgue@nokia.com>2010-10-28 15:39:18 +0300
committerAbdiel Janulgue <abdiel.janulgue@nokia.com>2010-10-28 15:39:18 +0300
commitfce1619841e703a5e8c559be54a06d67c723e190 (patch)
tree3c33c2e9b288ff8846f560de0d75af1e70e44606
parente715f11221de4ef0169e5fe1a62e7f00f97116a8 (diff)
parent934d8699a5e96642685502b8c82f1c6fc28365d6 (diff)
Merge commit 'refs/merge-requests/66' of git@gitorious.org:meegotouch/meegotouch-compositor0.7.7-1
-rw-r--r--mcompositor/xserverpinger.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/mcompositor/xserverpinger.cpp b/mcompositor/xserverpinger.cpp
index 76897b8..654cf39 100644
--- a/mcompositor/xserverpinger.cpp
+++ b/mcompositor/xserverpinger.cpp
@@ -68,13 +68,20 @@ void XServerPinger::tick()
qWarning("X is on holidays");
}
-// Start a new process and let our parent (the real mcompositor) go.
-// Die with the parent.
+// Start XServerPinger in a separate process if it's not running yet.
static void altmain() __attribute__((constructor));
static void altmain()
{
+ // Don't run again if the parent restarted.
+ if (getenv("XSERVERPINGER"))
+ return;
+ putenv("XSERVERPINGER=1");
+
+ // Start a new process and let our parent (the real mcompositor) go.
if (fork())
return;
+
+ // Die with the parent.
prctl(PR_SET_PDEATHSIG, SIGKILL);
int meh = 0;