On 08/04/2012 12:11 AM, Bernhard Voelker wrote:
> sorry for the long subject.
> 
> Have a nice day,
> Berny
> 
>>From e3978a7c2cd0f6da265f62809cf82174cd03d431 Mon Sep 17 00:00:00 2001
> From: Bernhard Voelker <[email protected]>
> Date: Sat, 4 Aug 2012 01:09:22 +0200
> Subject: [PATCH] df: fix exit code and ensure printing "unprocessed" msg when
>  totaling
> 
> When the combination of the file system options with given files or
> devices does not lead to output, "df --total" would exit successfully
> although it should not.
> 
> Examples:
>   $ df --total --type=xfs /          # when / is not an XFS file system
>   $ df --total --local -t nfs  DIR   # nfs is remote per se ...
>   $ df --total -t qwerty /dev/sdb5   # typo in file system type
> 
> Furthermore, "df --total" would not print the error message "no file
> systems processed" when the file argument does not exist or is otherwise
> not accessible.
> 
> Example:
>   $ df --total __not_exist__
> 
> These 2 bugs are present since --total was added by commit
> v6.12-166-gea2887b.

Great stuff,
thanks for all the detail and the test.
I was half wondering if it should exit(SUCCESS) if
anything was processed, but I think your patch is best as is,
at least for consistency with df without --total, and du --total.

I'll apply in a little while, after I review fully.

cheers,
Pádraig.

Reply via email to