summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2024-09-22 14:47:39 +0300
committerMavridis Philippe <mavridisf@gmail.com>2024-09-22 14:59:26 +0300
commitcc6f1bd569ef972ae648bff093cef96f145269c6 (patch)
tree494b96010c0b39bd54d31f5b56a96b7ee3697a14
parentb5af02e63c409d2968a6e5dae92eca050c86242e (diff)
downloadtdebase-cc6f1bd569ef972ae648bff093cef96f145269c6.tar.gz
tdebase-cc6f1bd569ef972ae648bff093cef96f145269c6.zip
TDESynDaemon: prevent more than one instance from running at the same time
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
-rw-r--r--kcontrol/input/tdesyndaemon.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/kcontrol/input/tdesyndaemon.cpp b/kcontrol/input/tdesyndaemon.cpp
index 92855e40a..2be3e992c 100644
--- a/kcontrol/input/tdesyndaemon.cpp
+++ b/kcontrol/input/tdesyndaemon.cpp
@@ -194,7 +194,13 @@ extern "C" TDE_EXPORT int main(int argc, char *argv[])
TDEApplication app;
app.disableSessionManagement();
+ if (app.dcopClient()->isApplicationRegistered("tdesyndaemon"))
+ {
+ kdWarning() << "TDESynDaemon already running, exiting..." << endl;
+ return 255;
+ }
app.dcopClient()->registerAs("tdesyndaemon", false);
+ app.dcopClient()->setDefaultObject("tdesyndaemon");
TDESynDaemon tdesyndaemon;
return app.exec();