Re: 2.4.23aa2 (bugfixes and important VM improvements for the highend)

From: Magnus Naeslund(t)
Date: Sat Mar 06 2004 - 08:14:45 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/