[PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Kamil Dudka
Hello, as requested in TODO, new option --total (-c) was added to df to produce grand total (in the same way as du). Proposed patch in attachment. Kamil From 6a688c574a03ccd7499fb9864ad9c568d29b6c5b Mon Sep 17 00:00:00 2001 From: Kamil Dudka <[EMAIL PROTECTED]> Date: Tue, 2 Sep 2008 10:13:33 +0

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Andreas Schwab
Kamil Dudka <[EMAIL PROTECTED]> writes: > @@ -296,7 +338,9 @@ show_dev (char const *disk, char const *mount_point, >if (!stat_file) > stat_file = mount_point ? mount_point : disk; > > - if (get_fs_usage (stat_file, disk, &fsu)) > + if (force_fsu) > +memcpy(&fsu, force_fsu, sizeof(

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Kamil Dudka
On Tuesday 02 September 2008 10:55:05 you wrote: >fsu = *force_fsu; I was not sure, if all supported compiler take this. > bzero is non-standard, and static variables are always initialized. I have already heard about it. But inode_format, show_all_fs, show_listed_fs, ... are initialized

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Andreas Schwab
Kamil Dudka <[EMAIL PROTECTED]> writes: > On Tuesday 02 September 2008 10:55:05 you wrote: >>fsu = *force_fsu; > I was not sure, if all supported compiler take this. Structure assignment is part of C since even before K&R2. http://c-faq.com/struct/firstclass.html Andreas. -- Andreas S

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Jim Meyering
Kamil Dudka <[EMAIL PROTECTED]> wrote: ... > New patch in attachment. Hi Kamil, Thanks for working on this! You'll want to print totals with --inodes (-i), too. Please adjust formatting to use spaces before each open parenthesis and drop the short-named "-c" option. There is a strong disincenti

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Andreas Schwab
Jim Meyering <[EMAIL PROTECTED]> writes: > Kamil Dudka <[EMAIL PROTECTED]> wrote: >> +#define LOG_EQ(a,b) (((a)&&(b))||(!(a)&&!(b))) > > This can be written more simply as !((a) ^ (b)) Only if the operands are already boolean, and then you can just use a == b. Andreas. -- Andreas Schwab, SuSE

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Jim Meyering
Andreas Schwab <[EMAIL PROTECTED]> wrote: > Jim Meyering <[EMAIL PROTECTED]> writes: >> Kamil Dudka <[EMAIL PROTECTED]> wrote: >>> +#define LOG_EQ(a,b) (((a)&&(b))||(!(a)&&!(b))) >> >> This can be written more simply as !((a) ^ (b)) > > Only if the operands are already boolean, and then you can jus

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread James Youngman
On Tue, Sep 2, 2008 at 12:06 PM, Jim Meyering <[EMAIL PROTECTED]> wrote: > Andreas Schwab <[EMAIL PROTECTED]> wrote: >> Jim Meyering <[EMAIL PROTECTED]> writes: >>> Kamil Dudka <[EMAIL PROTECTED]> wrote: +#define LOG_EQ(a,b) (((a)&&(b))||(!(a)&&!(b))) >>> >>> This can be written more simply as

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Jim Meyering
"James Youngman" <[EMAIL PROTECTED]> wrote: > On Tue, Sep 2, 2008 at 12:06 PM, Jim Meyering <[EMAIL PROTECTED]> wrote: >> Andreas Schwab <[EMAIL PROTECTED]> wrote: >>> Jim Meyering <[EMAIL PROTECTED]> writes: Kamil Dudka <[EMAIL PROTECTED]> wrote: > +#define LOG_EQ(a,b) (((a)&&(b))||(!(a)

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Kamil Dudka
On Tuesday 02 September 2008 11:52:57 you wrote: > You'll want to print totals with --inodes (-i), too. Good point, fixed... > Please adjust formatting to use spaces before each open parenthesis Sorry for this detail, I always forget. Note that this is not acceptable for macro definition with arg

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Jim Meyering
Kamil Dudka <[EMAIL PROTECTED]> wrote: > On Tuesday 02 September 2008 11:52:57 you wrote: >> You'll want to print totals with --inodes (-i), too. > Good point, fixed... > >> Please adjust formatting to use spaces before each open parenthesis > Sorry for this detail, I always forget. Note that this

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Andreas Schwab
Jim Meyering <[EMAIL PROTECTED]> writes: > diff --git a/tests/df/total b/tests/df/total > index be4bc19..5398deb 100755 > --- a/tests/df/total > +++ b/tests/df/total > @@ -29,12 +29,12 @@ fail=0 > umask 22 > > df > tmp || fail=1 > -grep ^total tmp && fail=1 > +grep '^total' tmp && fail=1 This w

Re: [PATCH] df: new option: --total (-c) to produce grand total (in the same way as du)

2008-09-02 Thread Jim Meyering
Andreas Schwab <[EMAIL PROTECTED]> wrote: > Jim Meyering <[EMAIL PROTECTED]> writes: > >> diff --git a/tests/df/total b/tests/df/total >> index be4bc19..5398deb 100755 >> --- a/tests/df/total >> +++ b/tests/df/total >> @@ -29,12 +29,12 @@ fail=0 >> umask 22 >> >> df > tmp || fail=1 >> -grep ^tot

Re: Bug#497514: coreutils: chmod, chown, and chgrp change ctime even when no change was necessary

2008-09-02 Thread Jim Meyering
Erik Rossen <[EMAIL PROTECTED]> wrote: > On Tue, Sep 02, 2008 at 08:19:38AM -0400, Michael Stone wrote: >> On Tue, Sep 02, 2008 at 11:30:46AM +0200, you wrote: >> >It would be nice if chmod (and chown and chgrp) only made changes to >> >inodes when necessary so as not to change the ctime of files.

Re: Bug#497514: coreutils: chmod, chown, and chgrp change ctime even when no change was necessary

2008-09-02 Thread Erik Rossen
On Tue, Sep 02, 2008 at 08:06:51PM +0200, Jim Meyering wrote: > Good idea. > At least for chmod, it is not only possible, but the optimization > would be essentially free, since chmod already has the required stat data. Yeah, I thought it was a good idea too. > AFAICS POSIX > (http://www.opengrou

Re: [PATCH]: Fix for several getdate.y issues (amended patch #3)

2008-09-02 Thread Jim Meyering
Ondřej Vašík <[EMAIL PROTECTED]> wrote: > Jim Meyering wrote: >> Documenting in getdate.texi will be enough, because that file is >> included by coreutils.texi. Thanks! > > Ok, here is amended version of the patch, first two (or less) digits are > considered as hours, TZ correction limit set to +/

Re: tee logs no output if stdout is closed

2008-09-02 Thread Jim Meyering
Bruno Haible <[EMAIL PROTECTED]> wrote: > 2008-08-31 Bruno Haible <[EMAIL PROTECTED]> > > * lib/close-stream.c (close_stream): Ignore error EPIPE from fclose. > > --- lib/close-stream.c.orig 2008-08-31 17:18:56.0 +0200 > +++ lib/close-stream.c2008-08-31 17:14:12.0

Re: Bug#497514: coreutils: chmod, chown, and chgrp change ctime even when no change was necessary

2008-09-02 Thread Bob Proulx
Erik Rossen wrote: > Jim Meyering wrote: > > For chgrp (probably chown, too, at least in some cases), it's not > > as obvious, since the current implementation does not stat files > > before changing permissions. So, to do what you want would involve > > adding a stat call per file to get owner/gr

Re: Bug#497514: coreutils: chmod, chown, and chgrp change ctime even when no change was necessary

2008-09-02 Thread Erik Rossen
On Tue, Sep 02, 2008 at 02:30:20PM -0600, Bob Proulx wrote: > Erik Rossen wrote: > > As far as speed is concerned, you are right that an extra stat() would > > usually not improve matters. (Would it be an enormous penalty? I doubt > > it.) But users of file integrity checking systems like myself

Re: descriptions of 'who' differ

2008-09-02 Thread Benno Schulenberg
Benno Schulenberg wrote: > The texts from 'who --help' and 'info who' say different things. > The latter does not mention the options -p, -r and -t. Oops, I was looking at 6.12. instead of git. Git does mention -p, -r and -t, but out of order. Attached patch puts them in their alphabetical pos

Re: tee logs no output if stdout is closed

2008-09-02 Thread Bruno Haible
Jim Meyering wrote: > If there is an EPIPE error, IMHO, close_stream must diagnose it. Well, then here is an amended patch (just for coreutils: 0001 and 0002, with a single ChangeLog entry) for the 'tee' program. The idea behind the patch is as follows: SIGPIPE is an optimization through which t