[BusyBox] bug#1113: BusyBox] bug#1113: df reports 0-0-0 for MSDOS (FAT) volumes

David Douthitt ssrat at mailbag.com
Fri Mar 2 17:50:00 UTC 2001


Matt Kraai wrote:
> 
> On Thu, Mar 01, 2001 at 06:40:57PM -0600, David Douthitt wrote:
> > David Douthitt wrote:
> > > df reports 0 for all values for an MSDOS FAT filesystem.  Output and
> > > versions attached.
> >
> > And now a fix....
> >
> > And the original error output I forgot to attach.... (oops!)
> > --- busybox.h Thu Mar  1 18:38:26 2001
> > +++ busybox.new.h     Thu Mar  1 18:36:19 2001
> > @@ -234,10 +234,10 @@
> >
> >  #ifdef BB_FEATURE_HUMAN_READABLE
> >  const char *format(unsigned long val, unsigned long hr);
> > +#define KILOBYTE 1024.0
> > +#define MEGABYTE (KILOBYTE*1024.0)
> > +#define GIGABYTE (MEGABYTE*1024.0)
> >  #endif
> > -#define KILOBYTE 1024
> > -#define MEGABYTE (KILOBYTE*1024)
> > -#define GIGABYTE (MEGABYTE*1024)
> >
> >  #ifdef BB_FEATURE_BUFFERS_GO_ON_STACK
> >  #define RESERVE_BB_BUFFER(buffer,len)           char buffer[len]
> 
> Note KILOBYTE is used in df.c even if BB_FEATURE_HUMAN_READABLE is
> not defined.  Putting it inside the #ifdef won't work.

I confused the patches.  The lines should read thus after patching:

#ifdef BB_FEATURE_HUMAN_READABLE
const char *format(unsigned long val, unsigned long hr);
#endif
#define KILOBYTE 1024.0
#define MEGABYTE (KILOBYTE*1024.0)
#define GIGABYTE (MEGABYTE*1024.0)

#ifdef BB_FEATURE_BUFFERS_GO_ON_STACK
#define RESERVE_BB_BUFFER(buffer,len)           char buffer[len]

Note that the values are floats, and are OUTSIDE the endif.  This is
basically my two patches combined correctly; my patch that I posted
didn't take this into account.






More information about the busybox mailing list