]> 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>
Tue, 4 Mar 2014 10:27:46 +0000 (11:27 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/partx.c

index ec48047c49bdc5b3639aa92c16214c6de0840dd6..44d38fd0eaf0f1c2ca72e6ae44bba8322604442f 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)))