[PATCH] eal: remove unnecessary argv[0] handling
Stephen Hemminger
stephen at networkplumber.org
Wed Feb 9 16:45:19 CET 2022
On Wed, 09 Feb 2022 15:58:26 +0100
Thomas Monjalon <thomas at monjalon.net> wrote:
> 02/02/2022 20:47, Stephen Hemminger:
> > The rte_eal_init function looks at argv[0] to determine
> > the program name to pass to the log init function.
> > This is both unnecessary and in a corner case a problem.
> >
> > Parsing argv[0] is unnecessary because the function openlog()
> > already determines the log identifier from program name if
> > NULL is passed, see openlog man page:
> > The string pointed to by ident is prepended to every message, and is
> > typically set to the program name. If ident is NULL, the program name
> > is used. (POSIX.1-2008 does not specify the behavior when ident is
> > NULL.)
>
> What about POSIX warning?
> Did you test it? Which libc? What about musl?
Source for musl shows that openlog accepts NULL as ident.
It then generates log messages with ident in the message.
More information about the dev
mailing list