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
This commit is contained in:
Jérôme Duval 2005-11-28 20:41:16 +00:00
parent b619f15f6d
commit c3ea345d20

View File

@ -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