![]() | |||||||||||||
Messages in this thread |
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 | |||||||||||||