Re: eval: Use sh_warnx instead of warnx

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

 



On Tue, 20 Nov 2018 10:09:26 +0800
Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:

> Antonio Ospite <ao2@xxxxxx> wrote:
> >
> > BTW a new warning was introduced by commit 8e43729 (eval: Report I/O
> > error on stdout, 2018-09-07):
> > 
> >  CC       eval.o
> > eval.c: In function ‘evalbltin’:
> > eval.c:956:3: warning: implicit declaration of function ‘warnx’; did you mean ‘sh_warnx’? [-Wimplicit-function-declaration]
> >   warnx("%s: I/O error", commandname);
> >   ^~~~~
> >   sh_warnx
> 
> Thanks for the heads up.
>

New warnings stand out more with silent rules on. :)

The change looks good to me.

Thank you,
   Antonio

> ---8<---
> This patch fixes a typo in evalbltin where warnx was used instead
> of sh_warnx.
> 
> Reported-by: Antonio Ospite <ao2@xxxxxx>
> Fixes: 8e43729547b5 ("eval: Report I/O error on stdout")
> 
> diff --git a/src/eval.c b/src/eval.c
> index 546ee1b..c27bc35 100644
> --- a/src/eval.c
> +++ b/src/eval.c
> @@ -953,7 +953,7 @@ evalbltin(const struct builtincmd *cmd, int argc, char **argv, int flags)
>  		status = (*cmd->builtin)(argc, argv);
>  	flushall();
>  	if (outerr(out1))
> -		warnx("%s: I/O error", commandname);
> +		sh_warnx("%s: I/O error", commandname);
>  	status |= outerr(out1);
>  	exitstatus = status;
>  cmddone:
> -- 
> Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux