df does not report my root file system
Bernhard Fischer
rep.nop at aon.at
Tue Jul 11 08:50:39 UTC 2006
On Tue, Jul 11, 2006 at 04:00:54PM +0800, Ming-Ching Tiew wrote:
>Not sure what do you mean by "This is correct". Did you mean my observation is
>correct or you mean bb is correct ? :-)
Your observation that it's broken since a long time is correct.
>
>Before I made the first post, I have already tried bug id 894 patch. It did not make
>any difference. Also bug id 145 patch could not be applied on bb 1.2.0.
Please try the attached updated patch from #145 and let me know if this
fixes the problem you are seeing
-------------- next part --------------
Index: libbb/find_mount_point.c
===================================================================
--- libbb/find_mount_point.c (revision 15683)
+++ libbb/find_mount_point.c (working copy)
@@ -27,7 +27,7 @@ struct mntent *find_mount_point(const ch
FILE *mountTable;
struct mntent *mountEntry;
- if (stat(name, &s) != 0)
+ if (stat(name, &s) != 0 && strcmp(name,"/dev/root"))
return 0;
if ((s.st_mode & S_IFMT) == S_IFBLK)
@@ -40,14 +40,15 @@ struct mntent *find_mount_point(const ch
return 0;
while ((mountEntry = getmntent(mountTable)) != 0) {
-
- if(strcmp(name, mountEntry->mnt_dir) == 0
- || strcmp(name, mountEntry->mnt_fsname) == 0) /* String match. */
- break;
- if (stat(mountEntry->mnt_fsname, &s) == 0 && s.st_rdev == mountDevice) /* Match the device. */
- break;
- if (stat(mountEntry->mnt_dir, &s) == 0 && s.st_dev == mountDevice) /* Match the directory's mount point. */
- break;
+ if (!strcmp(mountEntry->mnt_fsname, "rootfs"))
+ continue;
+ if (strcmp(name, mountEntry->mnt_dir) == 0
+ || strcmp(name, mountEntry->mnt_fsname) == 0)
+ break; /* String match. */
+ if (stat(mountEntry->mnt_fsname, &s) == 0 && s.st_rdev == mountDevice)
+ break; /* Match the device. */
+ if (stat(mountEntry->mnt_dir, &s) == 0 && s.st_dev == mountDevice)
+ break; /* Match the directory's mount point. */
}
endmntent(mountTable);
return mountEntry;
More information about the busybox
mailing list