From 45e7adfb9d2607473c2915d3155b1ba47ccb9bfe Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 24 May 2011 13:30:48 +0200 Subject: [PATCH] libblkid: improve blkid__scan_dir --- shlibs/blkid/src/devno.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.47.3