diff options
-rw-r--r-- | fstests/timertest.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/fstests/timertest.c b/fstests/timertest.c index 9f3ae74f..3c011fd9 100644 --- a/fstests/timertest.c +++ b/fstests/timertest.c @@ -46,9 +46,23 @@ main() while (1) { - printf ("Pausing\n"); + int c; + puts ("Pausing for input or one second..."); fflush (stdout); - sigpause (0); + c = getchar (); + if (ferror (stdin)) + { + perror ("getchar"); + exit (1); + } + if (c == EOF) + { + puts ("Saw EOF. Pausing (no input)..."); + fflush (stdout); + sigpause (0); + } + else + printf ("Saw %.3o\n", c); } } |