From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH v4 2/3] libxl: localtime(3) can return NULL Date: Fri, 17 Jul 2015 18:12:41 +0100 Message-ID: <20150717171241.GW12455@zion.uk.xensource.com> References: <1437152468-20076-1-git-send-email-wei.liu2@citrix.com> <1437152468-20076-3-git-send-email-wei.liu2@citrix.com> <21929.13801.538158.774737@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZG9Bm-0003am-I7 for xen-devel@lists.xenproject.org; Fri, 17 Jul 2015 17:12:46 +0000 Content-Disposition: inline In-Reply-To: <21929.13801.538158.774737@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Xen-devel , Wei Liu , Ian Campbell List-Id: xen-devel@lists.xenproject.org On Fri, Jul 17, 2015 at 06:05:45PM +0100, Ian Jackson wrote: > Wei Liu writes ("[PATCH v4 2/3] libxl: localtime(3) can return NULL"): > > Signed-off-by: Wei Liu > > > tm = localtime(&t); > > + if (!tm) { > > + LOG(ERROR, "Failed to call localtime"); > > localtime sets errno if it fails. So you mean LOGE. > Heh. Linux manpage doesn't say so. But http://pubs.opengroup.org/onlinepubs/009695399/functions/localtime.html does say that. I will rework this patch and send it out next week with other coverity scan inspired patches I accumulate. > Ian.