Consider media removed if no filename was provided when attaching

This commit is contained in:
Uwe Seimet 2021-08-22 09:55:47 +02:00
parent 524327f7be
commit 000b568dfb

View File

@ -634,6 +634,11 @@ bool ProcessCmd(int fd, const PbDeviceDefinition& pbDevice, const PbOperation cm
return ReturnStatus(fd, false, "Invalid device type " + PbDeviceType_Name(type));
}
// If no filename was provided the media is considered removed
if (filename.empty()) {
device->SetRemoved(true);
}
if (!pbDevice.name().empty()) {
try {
SetDeviceName(device, pbDevice.name());