[dpdk-dev] [PATCH 7/8] log: add log stream accessor

Stephen Hemminger stephen at networkplumber.org
Tue Oct 22 18:34:19 CEST 2019


On Tue, 22 Oct 2019 11:32:40 +0200
David Marchand <david.marchand at redhat.com> wrote:

> +	if (f == NULL) {
> +		f = default_log_stream;
> +		if (f == NULL) {
> +			/*
> +			 * Grab the current value of stderr here, rather than
> +			 * just initializing default_log_stream to stderr. This
> +			 * ensures that we will always use the current value
> +			 * of stderr, even if the application closes and
> +			 * reopens it.
> +			 */
> +			f = stderr;
> +		}
> +	}
> +	return f;

Why not just the short form?
	return default_log_stream ? : stderr;



More information about the dev mailing list