From ea7f012b7c4f74de3e352baeba4fde2b8f11d9b7 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 4 Mar 2014 11:30:03 +0100 Subject: [PATCH] lib/sysfs: make dirent d_type usage more robust Signed-off-by: Karel Zak --- lib/sysfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index 5203e63fc1..eee0827539 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) { -- 2.47.2