mirror of
https://github.com/akuker/RASCSI.git
synced 2025-02-28 07:29:04 +00:00
Reserved IDs should only have an effect on ATTACH (#298)
* Reserved IDs should only have an effect on ATTACH * Updated evaluation of reserved ID string
This commit is contained in:
parent
80e746b209
commit
b79fd17f6f
@ -490,8 +490,10 @@ string SetReservedIds(const string& ids)
|
|||||||
stringstream ss(ids);
|
stringstream ss(ids);
|
||||||
string id;
|
string id;
|
||||||
while (getline(ss, id, ',')) {
|
while (getline(ss, id, ',')) {
|
||||||
|
if (!id.empty()) {
|
||||||
ids_to_reserve.push_back(id);
|
ids_to_reserve.push_back(id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
set<int> reserved;
|
set<int> reserved;
|
||||||
for (string id_to_reserve : ids_to_reserve) {
|
for (string id_to_reserve : ids_to_reserve) {
|
||||||
@ -1110,7 +1112,7 @@ bool ProcessCmd(int fd, const PbDeviceDefinition& pb_device, const PbCommand& co
|
|||||||
return ReturnStatus(fd, false, error);
|
return ReturnStatus(fd, false, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reserved_ids.find(id) != reserved_ids.end()) {
|
if (operation == ATTACH && reserved_ids.find(id) != reserved_ids.end()) {
|
||||||
error << "Device ID " << id << " is reserved";
|
error << "Device ID " << id << " is reserved";
|
||||||
return ReturnStatus(fd, false, error);
|
return ReturnStatus(fd, false, error);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user