[PATCH] eal: remove unnecessary argv[0] handling

Thomas Monjalon thomas at monjalon.net
Wed Feb 9 15:58:26 CET 2022


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?

[...]
> -	if (eal_log_init(logid, internal_conf->syslog_facility) < 0) {
> +	if (eal_log_init(NULL, internal_conf->syslog_facility) < 0) {

We could completely remove the logid parameter.





More information about the dev mailing list