From: Stephen Drake Date: Mon, 18 Jan 2016 04:54:36 +0000 (+1300) Subject: gdb: support sleep interval of 1s or greater X-Git-Tag: v1.3~3^2 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=0ba0c726cf72ae4621e0801bd63f805bcc2a77d9;p=sx%2Fsimavr.git 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. --- 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)