Re: [PATCH 06/13] setarch: print usage error if no argument given

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

 



On Thu, Jun 22, 2017 at 04:37:39AM +0200, Ruediger Meier wrote:
> From: Ruediger Meier <ruediger.meier@xxxxxxxxxxx>
> 
> This looks more likely as intended.
> 
> Signed-off-by: Ruediger Meier <ruediger.meier@xxxxxxxxxxx>
> ---
>  sys-utils/setarch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
> index eb9cf21..6481eb2 100644
> --- a/sys-utils/setarch.c
> +++ b/sys-utils/setarch.c
> @@ -301,7 +301,7 @@ int main(int argc, char *argv[])
>  	textdomain(PACKAGE);
>  	atexit(close_stdout);
>  
> -	if (argc < 1)
> +	if (argc < 2)
>  		show_usage(_("Not enough arguments"));

I don't think so. 

We use setarch by symlinks (i386, uname26 linux32 linux64, ...) and in
this case it's executed without argument. The symlink name is good
enough.

The right solutions is to remove this entire if() block. 

Later in the code we have "no architecture argument specified".


    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux