From 82ec9916fb4c9bee801e22b36e2fc86fd64ab6c4 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 (cherry picked from commit cc6f1bd569ef972ae648bff093cef96f145269c6) --- kcontrol/input/tdesyndaemon.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kcontrol') diff --git a/kcontrol/input/tdesyndaemon.cpp b/kcontrol/input/tdesyndaemon.cpp index 46b6d1c92..a9dfebc01 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