[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4 2/3] libxl: localtime(3) can return NULL



On Wed, 2015-07-22 at 16:09 +0100, Wei Liu wrote:
> On Wed, Jul 22, 2015 at 03:19:08PM +0100, Ian Campbell wrote:
> > On Fri, 2015-07-17 at 18:12 +0100, Wei Liu wrote:
> > > 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 <wei.liu2@xxxxxxxxxx>
> > > > 
> > > > >          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/localtim
> > > e.ht
> > > ml
> > > 
> > > does say that.
> > > 
> > > I will rework this patch and send it out next week with other 
> > > coverity
> > > scan inspired patches I accumulate.
> > 
> > Should we not be using localtime_t in libxl? Afterall we don't know
> > what other threads in the application might be doing.
> > 
> 
> I guess you mean localtime_r.

yes.

> I agree with you we should use that one.
> 
> Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.