From eb5690b220b5018b93b47de52469b77442525bb6 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Thu, 25 May 2017 13:03:53 +0100 Subject: [PATCH] test/runpty.c: Add more detail to "timed out" message. test/install-mh/test-version-check was skipped due to timeout, but it took a lot less than the thirty-second timeout to run. Add start time and the time now to the diagnostic, and select(2)'s return value. --- test/runpty.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/runpty.c b/test/runpty.c index 2645d679..1585df94 100644 --- a/test/runpty.c +++ b/test/runpty.c @@ -24,7 +24,7 @@ int main(int argc, char *argv[]) { int master_in, master_out, slave, cc, status; - time_t starttime; + time_t starttime, now; const char *slavename; pid_t child; unsigned char readbuf[1024]; @@ -169,8 +169,10 @@ main(int argc, char *argv[]) } } - if (time(NULL) >= starttime + COMMAND_TIMEOUT) { - fprintf(stderr, "Command execution timed out\n"); + now = time(NULL); + if (now >= starttime + COMMAND_TIMEOUT) { + fprintf(stderr, "Command execution timed out: %ld to %ld: %d\n", + starttime, now, cc); break; } } -- 2.56.0