]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/sysfs: make dirent d_type usage more robust
authorKarel Zak <kzak@redhat.com>
Tue, 4 Mar 2014 10:30:03 +0000 (11:30 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 4 Mar 2014 10:30:03 +0000 (11:30 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/sysfs.c

index 5203e63fc10cad4f6275433624560a45c5312676..eee08275396dc4270ef08827ecb42b89df2724e4 100644 (file)
@@ -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) {