[Chris Abbey]
> [root@tweedle /mnt]# df /dev/sda1
> Filesystem         1024-blocks  Used Available Capacity Mounted on
> /dev/sda1             939573  628943   262093     71%   /
> [root@tweedle /mnt]# df /dev/sda
> Filesystem         1024-blocks  Used Available Capacity Mounted on
> /dev/sda              939573  628943   262093     71%
> [root@tweedle /mnt]# df /dev/sda3
> Filesystem         1024-blocks  Used Available Capacity Mounted on
> /dev/sda3             939573  628943   262093     71%
> [root@tweedle /mnt]# df /dev/hda
> Filesystem         1024-blocks  Used Available Capacity Mounted on
> /dev/hda              939573  628943   262093     71%
> [root@tweedle /mnt]# df /dev/hda1
> Filesystem         1024-blocks  Used Available Capacity Mounted on
> /dev/hda1             939573  628943   262093     71%

Lazy code, pretty much... once it's a block or char device, it
attempts to get that back to a mounted fs and display that filesystem
name.  If that fails, it just bails (pretty weak) instead of going
back to the code that can look up the fs mount point that the device
node was sitting in.  It's straightforward code, and any of about
a dozen fixes will work fine (show_dev returning an int for error,
if(show_dev(..)) show_point(..), for instance).. i just picked this
route to keep from changing return types.

I couldn't find anything about this issue in bugzilla, so:

http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=11292

--- fileutils-4.0p/src/df.c.jmm Mon May  8 02:42:13 2000
+++ fileutils-4.0p/src/df.c     Mon May  8 03:03:21 2000
@@ -433,8 +433,10 @@
 /* Identify the directory, if any, that device
    DISK is mounted on, and show its disk usage.  */
 
+static void show_point (const char *disk, const struct stat *statp);
+
 static void
-show_disk (const char *disk)
+show_disk (const char *disk, const struct stat *statp)
 {
   struct mount_entry *me;
 
@@ -445,8 +447,8 @@
                  me->me_dummy, me->me_remote);
        return;
       }
-  /* No filesystem is mounted on DISK. */
-  show_dev (disk, (char *) NULL, (char *) NULL, 0, 0);
+  /* No filesystem is mounted on DISK, fall back to show_point. */
+  show_point (disk, statp);
 }
 
 /* Return the root mountpoint of the filesystem on which FILE exists, in
@@ -706,7 +708,7 @@
 show_entry (const char *path, const struct stat *statp)
 {
   if (S_ISBLK (statp->st_mode) || S_ISCHR (statp->st_mode))
-    show_disk (path);
+    show_disk (path, statp);
   else
     show_point (path, statp);
 }

James

-- 
To unsubscribe:
mail -s unsubscribe [EMAIL PROTECTED] < /dev/null

Reply via email to