diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a82f7c64ae..fba2f4a995 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2019-08-29 Bernhard Wodok + Sergio Durigan Junior + + PR win32/24284 + * mingw-hdep.c (gdb_select): Handle case when 'n' is zero. + 2019-08-28 Andrew Burgess * symtab.c (search_symbols): Don't include MODULE_DOMAIN symbols diff --git a/gdb/mingw-hdep.c b/gdb/mingw-hdep.c index 44fb22e9a1..0af1b39acd 100644 --- a/gdb/mingw-hdep.c +++ b/gdb/mingw-hdep.c @@ -64,6 +64,17 @@ gdb_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, int num_ready; size_t indx; + if (n == 0) + { + /* The MS API says that the first argument to + WaitForMultipleObjects cannot be zero. That's why we just + use a regular Sleep here. */ + if (timeout != NULL) + Sleep (timeout->tv_sec * 1000 + timeout->tv_usec / 1000); + + return 0; + } + num_ready = 0; num_handles = 0; num_scbs = 0;