]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: improve blkid__scan_dir
authorKarel Zak <kzak@redhat.com>
Tue, 24 May 2011 11:30:48 +0000 (13:30 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 24 May 2011 11:30:48 +0000 (13:30 +0200)
shlibs/blkid/src/devno.c

index 5654f3cf6d7ccd6622b2a516e4dd95f4280f6648..dffafef8ca466b675824d4483fdbebc09dd67e66 100644 (file)
@@ -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);