summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarel Zak2014-03-04 11:30:03 +0100
committerKarel Zak2014-03-04 11:30:03 +0100
commitea7f012b7c4f74de3e352baeba4fde2b8f11d9b7 (patch)
treea85ad08574378d54749558011a90b5eefe17fa9c /lib
parentpartx: make dirent d_type usage more robust (diff)
downloadkernel-qcow2-util-linux-ea7f012b7c4f74de3e352baeba4fde2b8f11d9b7.tar.gz
kernel-qcow2-util-linux-ea7f012b7c4f74de3e352baeba4fde2b8f11d9b7.tar.xz
kernel-qcow2-util-linux-ea7f012b7c4f74de3e352baeba4fde2b8f11d9b7.zip
lib/sysfs: make dirent d_type usage more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/sysfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sysfs.c b/lib/sysfs.c
index 5203e63fc..eee082753 100644
--- a/lib/sysfs.c
+++ b/lib/sysfs.c
@@ -290,7 +290,8 @@ int sysfs_is_partition_dirent(DIR *dir, struct dirent *d, const char *parent_nam
#ifdef _DIRENT_HAVE_D_TYPE
if (d->d_type != DT_DIR &&
- d->d_type != DT_LNK)
+ d->d_type != DT_LNK &&
+ d->d_type != DT_UNKNOWN)
return 0;
#endif
if (parent_name) {