bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for 'df', --total from TODO


From: Paul Eggert
Subject: Re: patch for 'df', --total from TODO
Date: 15 Dec 2003 16:30:29 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Chris Van Nuys <address@hidden> writes:

> An example of the output (of course, it all lines up in the Unix
> shell, doesn't paste well into Eudora though):

This seems to be a problem with your patch as well.  Can you please
send your patches using a mechanism that doesn't mess up tabs or white
space?  Perhaps you'll need to attach them, though it'd be better if
you can send them inline.

Here are some comments about the patch that you sent:

> +/* Prints the total kilo, avail, and used, if --total is used */
> +char *print_total[1024];

This should be a char buffer, not a char * buffer; I'm surprised the
patched code compiled without diagnostics (did it?).  Also, there
shouldn't be an arbitrary limit on the length of the total line; the
code should still work even if the pathname is length 2000, for
example.

> +       if (calculate_total)
> +        {
> +           total_used += used;
> +          total_kbytes += total;
> +          total_available += available;

This doesn't sound right, as "used", "total", and "available" have
different units when they are used with different filesystems.  One
can't simply add them up.  The patch that you sent incorrectly assumes
that all filesystems use the same units.

>     SYNC_OPTION = CHAR_MAX + 1,
> -  NO_SYNC_OPTION
> +  NO_SYNC_OPTION,
> +  CALC_TOTAL
>   };

This should be TOTAL_OPTION, not CALC_TOTAL, for consistency with the
other enum names.

Also, the files doc/coreutils.texi and NEWS would need patches.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]