mirror of
https://github.com/systemd/systemd.git
synced 2026-08-07 00:21:01 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user