To make the generated IDs equivalent when
- sd_device object is not provided,
- sd_device object is provided, but it does not have ID_SERIAL.
Follow-up for
abc19a6ffaa94893ffc40cc000e5bb4437f67656.
This also fixes missing voidification.
Fixes CID#
1524253.
if (device) {
(void) sd_device_get_property_value(device, "ID_SERIAL", &serial);
if (!serial)
- sd_device_get_devpath(device, &serial);
- } else
+ (void) sd_device_get_devname(device, &serial);
+ }
+ if (!serial)
serial = node;
r = sd_id128_get_machine(&mid);