diff options
Diffstat (limited to 'tests/test-select-stdin.c')
-rw-r--r-- | tests/test-select-stdin.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/test-select-stdin.c b/tests/test-select-stdin.c index 079dec50e7..4e6441808b 100644 --- a/tests/test-select-stdin.c +++ b/tests/test-select-stdin.c @@ -47,34 +47,34 @@ main (void) gettimeofday (&after, NULL); spent_usec = (after.tv_sec - before.tv_sec) * 1000000 - + after.tv_usec - before.tv_usec; + + after.tv_usec - before.tv_usec; if (ret < 0) - { - perror ("select failed"); - exit (1); - } + { + perror ("select failed"); + exit (1); + } if ((ret == 0) != ! FD_ISSET (0, &readfds)) - { - fprintf (stderr, "incorrect return value\n"); - exit (1); - } + { + fprintf (stderr, "incorrect return value\n"); + exit (1); + } if (ret == 0) - { - if (spent_usec < 250000) - { - fprintf (stderr, "returned too early\n"); - exit (1); - } - /* Timeout */ - printf ("."); fflush (stdout); - } + { + if (spent_usec < 250000) + { + fprintf (stderr, "returned too early\n"); + exit (1); + } + /* Timeout */ + printf ("."); fflush (stdout); + } else - { - char c; + { + char c; - printf ("Input available! Trying to read 1 byte...\n"); - read (0, &c, 1); - } + printf ("Input available! Trying to read 1 byte...\n"); + read (0, &c, 1); + } } } |