mirror of
https://github.com/clearlinux/systemd-stable.git
synced 2026-09-05 13:11:32 +00:00
libudev: set errno properly in all error conditions of udev_device_new_from_syspath()
(cherry picked from commit 154e6f233a)
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
233fe6f6ae
commit
8a791603cb
@@ -730,8 +730,13 @@ _public_ struct udev_device *udev_device_new_from_syspath(struct udev *udev, con
|
||||
return NULL;
|
||||
} else {
|
||||
/* everything else just needs to be a directory */
|
||||
if (stat(path, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode))
|
||||
if (stat(path, &statbuf) != 0)
|
||||
return NULL;
|
||||
|
||||
if (!S_ISDIR(statbuf.st_mode)) {
|
||||
errno = EISDIR;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
udev_device = udev_device_new(udev);
|
||||
|
||||
Reference in New Issue
Block a user