summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--udevtrigger.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/udevtrigger.c b/udevtrigger.c
index c5628bd..af620c2 100644
--- a/udevtrigger.c
+++ b/udevtrigger.c
@@ -161,8 +161,9 @@ static int device_list_insert(const char *path)
dbg("add '%s'" , path);
- /* we only have a device, if we have an uevent file */
- if (!device_has_attribute(path, "/uevent", S_IWUSR))
+ /* we only have a device, if we have a dev and an uevent file */
+ if (!device_has_attribute(path, "/dev", S_IRUSR) ||
+ !device_has_attribute(path, "/uevent", S_IWUSR))
return -1;
strlcpy(devpath, &path[4], sizeof(devpath));