summaryrefslogtreecommitdiff
path: root/libudev/libudev-enumerate.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2010-12-12 20:07:15 +0100
committerKay Sievers <kay.sievers@vrfy.org>2010-12-12 20:07:15 +0100
commitcad40a5fe75d876af22f68b688494b9cd98cc899 (patch)
treee83a3a87fe2d8e9de28febd10741a379ad711f63 /libudev/libudev-enumerate.c
parent24d1076696ebe6696a8b8df414ab265aa6fc89c2 (diff)
udevd: switch to common id_filename functions
Diffstat (limited to 'libudev/libudev-enumerate.c')
-rw-r--r--libudev/libudev-enumerate.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/libudev/libudev-enumerate.c b/libudev/libudev-enumerate.c
index f13e56f2f7..363d445f90 100644
--- a/libudev/libudev-enumerate.c
+++ b/libudev/libudev-enumerate.c
@@ -714,22 +714,11 @@ int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate)
continue;
for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
struct udev_device *dev;
- char syspath[UTIL_PATH_SIZE];
- char *s;
- size_t l;
- ssize_t len;
if (dent->d_name[0] == '.')
continue;
- s = syspath;
- l = util_strpcpyl(&s, sizeof(syspath), udev_get_sys_path(udev), NULL);
- len = readlinkat(dirfd(dir), dent->d_name, s, l);
- if (len <= 0 || (size_t)len == l)
- continue;
- s[len] = '\0';
-
- dev = udev_device_new_from_syspath(udev_enumerate->udev, syspath);
+ dev = udev_device_new_from_id_filename(udev_enumerate->udev, dent->d_name);
if (dev == NULL)
continue;
syspath_add(udev_enumerate, udev_device_get_syspath(dev));