summaryrefslogtreecommitdiff
path: root/udev/lib
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2009-05-20 18:58:52 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-05-20 18:58:52 +0200
commite6c1a2bde7609cc703a5fad34c3bc1d15d19bbdc (patch)
treef3a7af4b7a2539833db52afff062afc81e504e8a /udev/lib
parenteba87f55f6383cd61a11fce2ae37ac8100d6ded2 (diff)
use openat(), unlinkat(), fstatat()
Diffstat (limited to 'udev/lib')
-rw-r--r--udev/lib/libudev-queue.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/udev/lib/libudev-queue.c b/udev/lib/libudev-queue.c
index a2860ec8c2..8dce6c314d 100644
--- a/udev/lib/libudev-queue.c
+++ b/udev/lib/libudev-queue.c
@@ -201,7 +201,6 @@ struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev
if (dir == NULL)
return NULL;
for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
- char filename[UTIL_PATH_SIZE];
char syspath[UTIL_PATH_SIZE];
char *s;
size_t l;
@@ -209,10 +208,9 @@ struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev
if (dent->d_name[0] == '.')
continue;
- util_strscpyl(filename, sizeof(filename), path, "/", dent->d_name, NULL);
s = syspath;
l = util_strpcpyl(&s, sizeof(syspath), udev_get_sys_path(udev_queue->udev), NULL);
- len = readlink(filename, s, l);
+ len = readlinkat(dirfd(dir), dent->d_name, s, l);
if (len < 0 || (size_t)len >= l)
continue;
s[len] = '\0';
@@ -246,10 +244,9 @@ struct udev_list_entry *udev_queue_get_failed_list_entry(struct udev_queue *udev
if (dent->d_name[0] == '.')
continue;
- util_strscpyl(filename, sizeof(filename), path, "/", dent->d_name, NULL);
s = syspath;
l = util_strpcpyl(&s, sizeof(syspath), udev_get_sys_path(udev_queue->udev), NULL);
- len = readlink(filename, s, l);
+ len = readlinkat(dirfd(dir), dent->d_name, s, l);
if (len < 0 || (size_t)len >= l)
continue;
s[len] = '\0';