lkml.org 
[lkml]   [2004]   [Mar]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateSat, 06 Mar 2004 14:13:28 +0100
From"Magnus Naeslund(t)" <>
SubjectRe: 2.4.23aa2 (bugfixes and important VM improvements for the high end)
Magnus Naeslund(t) wrote:
> 
> But isn't this kind of code a known buggy way of implementing timeouts?
> Shouldn't it be like:
> 
> time_t x = time(0);
> do {
>   ...
> } while (time(0) - x >= TIMEOUT_IN_SECONDS);

I meant:
  } while (time(0) - x < TIMEOUT_IN_SECONDS);
Also if time_t is signed, that needs to be taken care of.

Magnus - butterfingers

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:01    [W:0.345 / U:0.060 seconds]
©2003-2008 Jasper Spaans