[BusyBox] bug#1094: "df" => divide by zero when showing ramfs stats

Philipp Roebrock pro at sysgo.de
Wed Jan 17 11:35:43 UTC 2001


Package: busybox
Version: 0.48
Severity: low

When I use a ramfs filesystem, and show the filesystem statistics with df, I get
a divide by zero exception, df is halted immediately.

The file df.c contains a "statfs" call, that returns a null for the total
blocks and free blocks count of a ramfs filesystem. If "Use%"
(blocks_percent_used) is calculated, you get the division by zero:
Used%=(used*100)/(used+avail) with used=0, avail=0 !

The normal df (e.g. under SuSE Linux 7.0) has the same problem.  :-)

P.







More information about the busybox mailing list