Skip to content

Commit

Permalink
Display "????" for unknown device types
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Sep 23, 2024
1 parent a0a425d commit b5951c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cpp/s2pctl/s2pctl_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ string S2pCtlDisplay::DisplayDeviceInfo(const PbDevice &pb_device) const
{
ostringstream s;

s << " " << pb_device.id() << ":" << pb_device.unit() << " " << PbDeviceType_Name(pb_device.type())
const string &type = PbDeviceType_IsValid(pb_device.type()) ? PbDeviceType_Name(pb_device.type()) : "????";

s << " " << pb_device.id() << ":" << pb_device.unit() << " " << type
<< " " << pb_device.vendor() << ":" << pb_device.product() << ":" << pb_device.revision();

// Check for existence because PiSCSI does not support this setting
Expand Down

0 comments on commit b5951c5

Please sign in to comment.