From c3ea345d207303c00111a9b498e250ea40eda138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 28 Nov 2005 20:41:16 +0000 Subject: [PATCH] starting a running device or stopping a stopped device isn't allowed git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15203 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/input/InputServer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/servers/input/InputServer.cpp b/src/servers/input/InputServer.cpp index 7cc814b7e0..c0b16fcd39 100644 --- a/src/servers/input/InputServer.cpp +++ b/src/servers/input/InputServer.cpp @@ -1166,11 +1166,14 @@ InputServer::StartStopDevices(const char* name, input_device_type type, bool doS continue; if (item->Matches(name, type)) { + if (!doStart ^ item->Running()) + return B_ERROR; + if (doStart) item->Start(); else item->Stop(); - + if (name) return B_OK; } @@ -1192,6 +1195,9 @@ InputServer::StartStopDevices(BInputServerDevice& serverDevice, bool doStart) InputDeviceListItem* item = _FindInputDeviceListItem(serverDevice); if (item != NULL) { + if (!doStart ^ item->Running()) + return B_ERROR; + if (doStart) item->Start(); else