[sheepdog] [PATCH] lib/option: support 'B' notation for byte

Liu Yuan namei.unix at gmail.com
Mon Feb 17 10:30:53 CET 2014


On Wed, Feb 12, 2014 at 03:51:27PM +0800, Liu Yuan wrote:
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  lib/option.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/option.c b/lib/option.c
> index 872a573..21bdf68 100644
> --- a/lib/option.c
> +++ b/lib/option.c
> @@ -87,14 +87,16 @@ int option_parse_size(const char *value, uint64_t *ret)
>  	case 'k':
>  		sizef *= 1024;
>  	case 'b':
> +	case 'B':
>  	case '\0':
>  		*ret = (uint64_t) sizef;
>  		break;
>  	default:
>  err:
>  		sd_err("Invalid size '%s'", value);
> -		sd_err("You may use k, M, G, T or P suffixes for "
> -		       "kilobytes, megabytes, gigabytes, terabytes and petabytes.");
> +		sd_err("You may use B, K, M, G, T or P suffixes for "
> +		       "bytes, kilobytes, megabytes, gigabytes, terabytes and"
> +		       " petabytes.");
>  		return -1;
>  	}
>  
> -- 
> 1.8.1.2
> 

Applied

Yuan



More information about the sheepdog mailing list