projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4554832
)
libudev: set errno properly in all error conditions of udev_device_new_from_syspath()
author
Lennart Poettering
<lennart@poettering.net>
Wed, 3 Dec 2014 00:59:42 +0000
(
01:59
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 3 Dec 2014 01:04:55 +0000
(
02:04
+0100)
src/libudev/libudev-device.c
patch
|
blob
|
history
diff --git
a/src/libudev/libudev-device.c
b/src/libudev/libudev-device.c
index
5f196bd
..
16ee1f4
100644
(file)
--- a/
src/libudev/libudev-device.c
+++ b/
src/libudev/libudev-device.c
@@
-723,8
+723,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);