diff mbox series

eval: Use sh_warnx instead of warnx

Message ID 20181120020926.i6hjxecmnpl7oedg@gondor.apana.org.au (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series eval: Use sh_warnx instead of warnx | expand

Commit Message

Herbert Xu Nov. 20, 2018, 2:09 a.m. UTC
Antonio Ospite <ao2@ao2.it> 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.

---8<---
This patch fixes a typo in evalbltin where warnx was used instead
of sh_warnx.

Reported-by: Antonio Ospite <ao2@ao2.it>
Fixes: 8e43729547b5 ("eval: Report I/O error on stdout")

Comments

Antonio Ospite Nov. 20, 2018, 10:51 p.m. UTC | #1
On Tue, 20 Nov 2018 10:09:26 +0800
Herbert Xu <herbert@gondor.apana.org.au> wrote:

> Antonio Ospite <ao2@ao2.it> 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@ao2.it>
> 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@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff mbox series

Patch

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: