From: Karel Zak Date: Tue, 24 May 2011 11:30:48 +0000 (+0200) Subject: libblkid: improve blkid__scan_dir X-Git-Tag: v2.20-rc1~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45e7adfb9d2607473c2915d3155b1ba47ccb9bfe;p=thirdparty%2Futil-linux.git libblkid: improve blkid__scan_dir --- diff --git a/shlibs/blkid/src/devno.c b/shlibs/blkid/src/devno.c index 5654f3cf6d..dffafef8ca 100644 --- a/shlibs/blkid/src/devno.c +++ b/shlibs/blkid/src/devno.c @@ -174,8 +174,12 @@ void blkid__scan_dir(char *dirname, dev_t devno, struct dir_list **list, continue; /* symlink or lstat() failed */ } - if (strcmp(".udev", dp->d_name) == 0) - /* udev private direcory is huge and uninteresting */ + if (*dp->d_name == '.' || ( +#ifdef _DIRENT_HAVE_D_TYPE + dp->d_type == DT_DIR && +#endif + strcmp(dp->d_name, "shm") == 0)) + /* ignore /dev/.{udev,mount,mdadm} and /dev/shm */ continue; add_to_dirlist(dirname, dp->d_name, list);