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

Mark Whitley markw at lineo.com
Fri Mar 2 16:54:56 UTC 2001


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]

I applied this patch, compiled, and got the following error:


gcc -I- -Wall -Os -fomit-frame-pointer -D_GNU_SOURCE  -DBB_VER='"0.50pre"'
-DBB_BT='"2001.03.02-16:45+0000"'  -I.  -c df.c -o df.o
df.c: In function `df':
df.c:66: case label does not reduce to an integer constant
df.c:70: case label does not reduce to an integer constant
df.c:67: warning: unreachable code at beginning of switch statement
make: *** [df.o] Error 1


I've often wished that case labels could be a little more accomodating. :-/

I need to look at the df.c code a little closer anyway to see what's going on
with the -h bug. Maybe casting KILOBYTE and friends to floats for the math ops
would help, maybe not; I'll hafta look.

FYI, this bug also applies to NFS mounted filesystems. I'll re-title the bug
to include that.


Mark Whitley
markw at lineo.com






More information about the busybox mailing list