summaryrefslogtreecommitdiff
path: root/packages/busybox/busybox-1.00/df.patch
blob: 49888293fdba28fdbeed323424273a4106e509bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--- busybox-1.00/coreutils/df.c.orig	2006-07-14 09:50:47.914912750 -0400
+++ busybox-1.00/coreutils/df.c	2006-07-14 09:52:32.613456000 -0400
@@ -60,6 +60,7 @@
 	struct statfs s;
 	static const char hdr_1k[] = "1k-blocks"; /* default display is kilobytes */
 	const char *disp_units_hdr = hdr_1k;
+	int root_done = 0;
 
 #ifdef CONFIG_FEATURE_HUMAN_READABLE
 	bb_opt_complementaly = "h-km:k-hm:m-hk";
@@ -125,14 +126,14 @@
 									   ) / (blocks_used + s.f_bavail);
 			}
 
-			if (strcmp(device, "rootfs") == 0) {
-				continue;
-			} else if (strcmp(device, "/dev/root") == 0) {
+			if (strcmp(device, "/dev/root") == 0 || strcmp(device, "rootfs") == 0) {
+				if (root_done) continue;
 				/* Adjusts device to be the real root device,
 				* or leaves device alone if it can't find it */
 				if ((device = find_real_root_device_name()) == NULL) {
 					goto SET_ERROR;
 				}
+				root_done = 1;
 			}
 
 #ifdef CONFIG_FEATURE_HUMAN_READABLE