[BusyBox-cvs] busybox.stable/libbb find_root_device.c,1.6,1.7

Erik Andersen andersen at busybox.net
Tue Jan 13 11:35:07 UTC 2004


Update of /var/cvs/busybox.stable/libbb
In directory nail:/tmp/cvs-serv14081/libbb

Modified Files:
	find_root_device.c 
Log Message:
Fix a bug where mount could display the wrong device


Index: find_root_device.c
===================================================================
RCS file: /var/cvs/busybox.stable/libbb/find_root_device.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- find_root_device.c	6 Dec 2001 08:10:07 -0000	1.6
+++ find_root_device.c	13 Jan 2004 11:35:04 -0000	1.7
@@ -40,8 +40,11 @@
 	if (stat("/", &rootStat) != 0) 
 		perror_msg("could not stat '/'");
 	else {
-		if ((dev = rootStat.st_rdev)==0) 
-			dev=rootStat.st_dev;
+		/* This check is here in case they pass in /dev name */
+		if ((rootStat.st_mode & S_IFMT) == S_IFBLK)
+			dev = rootStat.st_rdev;
+		else
+			dev = rootStat.st_dev;
 
 		dir = opendir("/dev");
 		if (!dir) 




More information about the busybox-cvs mailing list