From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v4] log: respect rte_openlog_stream calls before rte_eal_init Date: Wed, 12 Oct 2016 21:47:32 +0200 Message-ID: <2906824.LEp5vtMuTD@xps13> References: <20160928204244.8288-1-ouster@cs.stanford.edu> <20161012193832.5016-1-ouster@cs.stanford.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: John Ousterhout Return-path: Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) by dpdk.org (Postfix) with ESMTP id 14FC437B4 for ; Wed, 12 Oct 2016 21:47:34 +0200 (CEST) Received: by mail-lf0-f54.google.com with SMTP id x79so94680453lff.0 for ; Wed, 12 Oct 2016 12:47:34 -0700 (PDT) In-Reply-To: <20161012193832.5016-1-ouster@cs.stanford.edu> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-10-12 12:38, John Ousterhout: > @@ -127,6 +125,19 @@ rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap) > { > int ret; > FILE *f = rte_logs.file; > + 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; > + } > + } I don't understand this big comment. What is the difference with initializing default_log_stream to stderr? What do you mean by "if the application closes and reopens it"?