sd-device: try to get DISKSEQ from uevent file

Otherwise, if the sd-device object is created from e.g. syspath, then
sd_device_get_diskseq() returns -ENOENT.
This commit is contained in:
Yu Watanabe
2022-03-31 03:27:17 +09:00
parent a43129b0a0
commit becbcca5b8

View File

@@ -1138,8 +1138,14 @@ _public_ int sd_device_get_seqnum(sd_device *device, uint64_t *ret) {
}
_public_ int sd_device_get_diskseq(sd_device *device, uint64_t *ret) {
int r;
assert_return(device, -EINVAL);
r = device_read_uevent_file(device);
if (r < 0)
return r;
if (device->diskseq == 0)
return -ENOENT;