svn commit: trunk/busybox/util-linux

landley at busybox.net landley at busybox.net
Tue Jun 13 18:27:19 UTC 2006


Author: landley
Date: 2006-06-13 11:27:16 -0700 (Tue, 13 Jun 2006)
New Revision: 15374

Log:
Work around a persistent uClibc bug, since 0.9.29 still hasn't shipped.
Poked to do this by Jason Schoon.


Modified:
   trunk/busybox/util-linux/mdev.c


Changeset:
Modified: trunk/busybox/util-linux/mdev.c
===================================================================
--- trunk/busybox/util-linux/mdev.c	2006-06-13 17:10:26 UTC (rev 15373)
+++ trunk/busybox/util-linux/mdev.c	2006-06-13 18:27:16 UTC (rev 15374)
@@ -197,18 +197,19 @@
 		return;
 
 	while ((entry = readdir(dir)) != NULL) {
+		struct stat st;
 
 		/* Skip "." and ".." (also skips hidden files, which is ok) */
 
 		if (entry->d_name[0] == '.')
 			continue;
 
-		if (entry->d_type == DT_DIR) {
-			snprintf(path+len, PATH_MAX-len, "/%s", entry->d_name);
-			find_dev(path);
-			path[len] = 0;
-		}
+		// uClibc doesn't fill out entry->d_type reliably. so we use lstat().
 
+		snprintf(path+len, PATH_MAX-len, "/%s", entry->d_name);
+		if (!lstat(path, &st) && S_ISDIR(st.st_mode)) find_dev(path);
+		path[len] = 0;
+
 		/* If there's a dev entry, mknod it */
 
 		if (!strcmp(entry->d_name, "dev")) make_device(path);




More information about the busybox-cvs mailing list