]> 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>
Wed, 23 Apr 2014 09:55:07 +0000 (11:55 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/sysfs.c

index ed0173a1cc8b9145030e4ee3471d766a78777084..ba3a0d0300547f88a7c56832cb99551dae7fad12 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) {