mirror of
https://github.com/systemd/systemd.git
synced 2025-09-07 09:44:44 +03:00
sd-device: make sd_device_get_devtype() return 0 on success again
This partially reverts the commit 730b76bd2c
.
Before the commit, the function returned 0 on success, but the commit
made the function always return 1, as if device->devtype is NULL, the
function returns -ENOENT in the above.
Fortunately, udev_device_get_devtype() does not propagate any
non-negative value from sd_device_get_devtype(). Hence, hopefully we can
safely revert the change.
This commit is contained in:
@@ -1211,7 +1211,7 @@ _public_ int sd_device_get_devtype(sd_device *device, const char **devtype) {
|
|||||||
if (devtype)
|
if (devtype)
|
||||||
*devtype = device->devtype;
|
*devtype = device->devtype;
|
||||||
|
|
||||||
return !!device->devtype;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_public_ int sd_device_get_parent_with_subsystem_devtype(sd_device *device, const char *subsystem, const char *devtype, sd_device **ret) {
|
_public_ int sd_device_get_parent_with_subsystem_devtype(sd_device *device, const char *subsystem, const char *devtype, sd_device **ret) {
|
||||||
|
Reference in New Issue
Block a user