On Thu, Jun 14, 2007 at 09:00:41PM +0200, Denis Vlasenko wrote:
> On Thursday 14 June 2007 16:41, Luciano Rocha wrote:
> > On Thu, Jun 14, 2007 at 04:12:20PM +0200, Tito wrote:
> > > +static int my_gettimeofday(void)
> > > +{
> > > + struct timeval now;
> > > + 
> > > + if (gettimeofday(&now, NULL))
> > > +         return 0;
> > > + return (now.tv_sec * 1000000 + now.tv_usec);
> > 
> > Err, this overflows in current 32bits systems. tv_sec is already in the
> > 31 bit limit (1181831862).
> > 
> > Use long long instead.
> 
> But he uses these only for time diff (t2 - t1 style thing).
> It's ok then.

Well, as long as we're not expecting a time diff of (a little) more than
an hour...
 
-- 
lfr
0/0

Attachment: pgpJDlqC3uRMW.pgp
Description: PGP signature

_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to