diff options
author | Karel Zak | 2011-05-16 17:20:55 +0200 |
---|---|---|
committer | Karel Zak | 2011-05-16 20:22:52 +0200 |
commit | d8a84552fb6539eaa2c15882d434e3845d758014 (patch) | |
tree | 40ffda4b41c0eb21a5142a14b373f3e74643a5f4 /lib | |
parent | lsblk: use generic sysfs functions (diff) | |
download | kernel-qcow2-util-linux-d8a84552fb6539eaa2c15882d434e3845d758014.tar.gz kernel-qcow2-util-linux-d8a84552fb6539eaa2c15882d434e3845d758014.tar.xz kernel-qcow2-util-linux-d8a84552fb6539eaa2c15882d434e3845d758014.zip |
libblkid: use stuff from sysfs.h and at.h
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sysfs.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sysfs.c b/lib/sysfs.c index aba12864e..bc380c030 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -152,6 +152,13 @@ int sysfs_stat(struct sysfs_cxt *cxt, const char *attr, struct stat *st) return rc; } +int sysfs_has_attribute(struct sysfs_cxt *cxt, const char *attr) +{ + struct stat st; + + return sysfs_stat(cxt, attr, &st) == 0; +} + static int sysfs_open(struct sysfs_cxt *cxt, const char *attr) { int fd = open_at(cxt->dir_fd, cxt->dir_path, attr, O_RDONLY); |