From 0ba0c726cf72ae4621e0801bd63f805bcc2a77d9 Mon Sep 17 00:00:00 2001 From: Stephen Drake Date: Mon, 18 Jan 2016 17:54:36 +1300 Subject: [PATCH] gdb: support sleep interval of 1s or greater Split sleep interval into seconds and microseconds to create a valid timeval to pass as the timeout to select(). Removed comment, which refers to old code that used a fixed interval. --- simavr/sim/sim_gdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simavr/sim/sim_gdb.c b/simavr/sim/sim_gdb.c index e7d95ef..6248e6b 100644 --- a/simavr/sim/sim_gdb.c +++ b/simavr/sim/sim_gdb.c @@ -486,7 +486,7 @@ gdb_network_handler( FD_SET(g->listen, &read_set); max = g->listen + 1; } - struct timeval timo = { 0, dosleep }; // short, but not too short interval + struct timeval timo = { dosleep / 1000000, dosleep % 1000000 }; int ret = select(max, &read_set, NULL, NULL, &timo); if (ret == 0) -- 2.39.5