[patch,fortran] Fix corner case where consecutive calls to date_and_time can return times out of sequence (PR30015)

FX Coudert fxcoudert@gmail.com
Tue Dec 5 06:40:00 GMT 2006


:REVIEWMAIL:

> Thus, if you don't like the patch, since the effect of the corner case
> is now in the minute/seconds rather than in the second/milliseconds

I think your patch makes it better than the current case, but reading  
the OpenGroup standards for time() and gettimeofday() [see http:// 
www.opengroup.org/onlinepubs/000095399/functions/gettimeofday.html  
and http://www.opengroup.org/onlinepubs/000095399/functions/ 
time.html] I think we can do better with only a call to gettimeofday:

   (void) gettimeofday (&tv, &tz);
   lt = &tv.tv_sec; // instead of lt = time();

Then, we'll have a one-libcal strategy for date_and_time, which is  
sure not to lead to any inconsistency.

So, you might want to do that if HAVE_GETTIMEOFDAY &&  
GETTIMEOFDAY_ONE_ARGUMENT, you want to do a similar thing without ! 
GETTIMEOFDAY_ONE_ARGUMENT (similar to what we do currently) and use  
time() only if !HAVE_GETTIMEOFDAY.

Thanks for taking care of that,
FX



More information about the Fortran mailing list