From cc6f1bd569ef972ae648bff093cef96f145269c6 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Sun, 22 Sep 2024 14:47:39 +0300 Subject: TDESynDaemon: prevent more than one instance from running at the same time Signed-off-by: Mavridis Philippe --- kcontrol/input/tdesyndaemon.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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(); -- cgit v1.2.1