Commit 55617e92 authored by Per Cederqvist's avatar Per Cederqvist

Avoid an eternal loop in the test suite.

* src/server/testsuite/timeval-overflow.c (main): Now a tiny bit more
portable.  This code still violates the C standard, but at least it
works as intended in gcc 4.4.1 now.  The old code was optimized to an
eternal loop. :-)
parent 814d2828
2010-03-31 Per Cederqvist <ceder@lysator.liu.se>
Avoid an eternal loop in the test suite.
* src/server/testsuite/timeval-overflow.c (main): Now a tiny bit
more portable. This code still violates the C standard, but at
least it works as intended in gcc 4.4.1 now. The old code was
optimized to an eternal loop. :-)
The tests expects the garb to run, so enable it.
* src/server/testsuite/config/unix.exp (lyskomd_start): Turn on
the garb, unless the test case explicitly disables it.
......
......@@ -38,12 +38,13 @@ main(void)
struct timeval tv;
struct timeval next;
tv.tv_sec = ~0;
tv.tv_sec = 0;
tv.tv_sec = ~tv.tv_sec;
if (tv.tv_sec < 0)
{
for (next.tv_sec = 0; ; next.tv_sec = 2 * next.tv_sec + 1)
{
if (next.tv_sec < 0)
if (next.tv_sec <= tv.tv_sec)
break;
tv = next;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment