]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
partx: make dirent d_type usage more robust
authorKarel Zak <kzak@redhat.com>
Tue, 4 Mar 2014 10:27:46 +0000 (11:27 +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>
disk-utils/partx.c

index df03e591e3fcd7365dd5cd06a9f41514e8d8d017..52c8b9da44e11c045ca6083059887d25e925202c 100644 (file)
@@ -234,7 +234,7 @@ static int get_max_partno(const char *disk, dev_t devno)
                    !strcmp(d->d_name, ".."))
                        continue;
 #ifdef _DIRENT_HAVE_D_TYPE
-               if (d->d_type != DT_DIR)
+               if (d->d_type != DT_DIR && d->d_type != DT_UNKNOWN)
                        continue;
 #endif
                if (strncmp(parent, d->d_name, strlen(parent)))