diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index 66e065225b..f686debeaa 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -92,6 +92,7 @@ static int readchar_callback = NOT_SCHEDULED; static int readchar (void); static void reset_readchar (void); static void reschedule (void); +static void input_interrupt (int); /* A cache entry for a successfully looked-up symbol. */ struct sym_cache @@ -149,6 +150,10 @@ enable_async_notification (int fd) fcntl (fd, F_SETOWN, getpid ()); #endif #endif + /* Install SIGIO handler. */ +#ifndef USE_WIN32API + signal (SIGIO, input_interrupt); +#endif } static int @@ -859,11 +864,6 @@ initialize_async_io (void) /* Make sure that async I/O starts blocked. */ async_io_enabled = 1; disable_async_io (); - - /* Install the signal handler. */ -#ifndef USE_WIN32API - signal (SIGIO, input_interrupt); -#endif } /* Internal buffer used by readchar.