diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-05-20 18:58:52 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-05-20 18:58:52 +0200 |
commit | e6c1a2bde7609cc703a5fad34c3bc1d15d19bbdc (patch) | |
tree | f3a7af4b7a2539833db52afff062afc81e504e8a /udev/udevadm-info.c | |
parent | eba87f55f6383cd61a11fce2ae37ac8100d6ded2 (diff) |
use openat(), unlinkat(), fstatat()
Diffstat (limited to 'udev/udevadm-info.c')
-rw-r--r-- | udev/udevadm-info.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/udev/udevadm-info.c b/udev/udevadm-info.c index db11a289b2..b743a1d642 100644 --- a/udev/udevadm-info.c +++ b/udev/udevadm-info.c @@ -25,6 +25,7 @@ #include <dirent.h> #include <errno.h> #include <getopt.h> +#include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> @@ -40,7 +41,6 @@ static void print_all_attributes(struct udev_device *device, const char *key) if (dir != NULL) { for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) { struct stat statbuf; - char filename[UTIL_PATH_SIZE]; const char *value; size_t len; @@ -52,8 +52,7 @@ static void print_all_attributes(struct udev_device *device, const char *key) if (strcmp(dent->d_name, "dev") == 0) continue; - util_strscpyl(filename, sizeof(filename), udev_device_get_syspath(device), "/", dent->d_name, NULL); - if (lstat(filename, &statbuf) != 0) + if (fstatat(dirfd(dir), dent->d_name, &statbuf, AT_SYMLINK_NOFOLLOW) != 0) continue; if (S_ISLNK(statbuf.st_mode)) continue; |