# HG changeset patch # User Bruno Haible # Date 1293472367 -3600 # Node ID eb1a951e4f56be16bfbcfe9e249b4bd674788c85 # Parent cf58f3c67722ce343bbd222a5350d6d1159a8c57 select tests: Safer way of handling timeout. * tests/test-select.c (do_select_nowait): Zero-initialize the timeout at every invocation. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-12-27 Bruno Haible + + select tests: Safer way of handling timeout. + * tests/test-select.c (do_select_nowait): Zero-initialize the timeout + at every invocation. + 2010-12-27 Bruno Haible select tests: Use 'bool' where appropriate. diff --git a/tests/test-select.c b/tests/test-select.c --- a/tests/test-select.c +++ b/tests/test-select.c @@ -204,7 +204,9 @@ static int do_select_nowait (int fd, int ev) { - static struct timeval tv0; + struct timeval tv0; + tv0.tv_sec = 0; + tv0.tv_usec = 0; return do_select (fd, ev, &tv0); }