mirror of
https://github.com/systemd/systemd
synced 2024-09-06 16:56:43 +00:00
storagetm: use path to device node instead of devpath
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 abc19a6ffa
.
This also fixes missing voidification.
Fixes CID#1524253.
This commit is contained in:
parent
4ce6e7d158
commit
921961c3a3
|
@ -326,8 +326,9 @@ static int nvme_namespace_write_metadata(int namespace_fd, sd_device *device, co
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue