Permalink
Browse files

partx: make dirent d_type usage more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information...
1 parent 870c616 commit a7c60528f91e62d24ea5c69042f31c5975a599c1 @karelzak committed Mar 4, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 disk-utils/partx.c
View
2 disk-utils/partx.c
@@ -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)))

0 comments on commit a7c6052

Please sign in to comment.