diff options
author | Fred Fish <fnf@specifix.com> | 1996-11-16 06:58:43 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1996-11-16 06:58:43 +0000 |
commit | e172af811a64e236a41c84279e7b5d3b60f3c64e (patch) | |
tree | 98cdc9dc42b4a9dfb220c4d2fe0bdab16307b9f8 /gdb/procfs.c | |
parent | 2583a05ba21aa5d54ca38ddd9b4b265c20cb36e1 (diff) | |
download | gdb-e172af811a64e236a41c84279e7b5d3b60f3c64e.zip gdb-e172af811a64e236a41c84279e7b5d3b60f3c64e.tar.gz gdb-e172af811a64e236a41c84279e7b5d3b60f3c64e.tar.bz2 |
From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>
* procfs.c (wait_fd): Handle EINTR error return from poll
by restarting the poll.
* defs.h (PIDGET): Define a default version that just
returns its argument unchanged.
* inflow.c (terminal_init_inferior): Eliminate #ifdef
of PIDGET and fold both alternatives into common code.
(pass_signal): Use PIDGET for pid passed to kill().
Diffstat (limited to 'gdb/procfs.c')
-rw-r--r-- | gdb/procfs.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gdb/procfs.c b/gdb/procfs.c index f5e93fc..315110f 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -639,7 +639,16 @@ wait_fd () set_sigio_trap (); #ifndef LOSING_POLL - num_fds = poll (poll_list, num_poll_list, -1); + while (1) + { + num_fds = poll (poll_list, num_poll_list, -1); + if (num_fds > 0) + break; + if (num_fds < 0 && errno == EINTR) + continue; + print_sys_errmsg ("poll failed", errno); + error ("Poll failed, returned %d", num_fds); + } #else pi = current_procinfo; @@ -665,12 +674,6 @@ wait_fd () #ifndef LOSING_POLL - if (num_fds <= 0) - { - print_sys_errmsg ("poll failed\n", errno); - error ("Poll failed, returned %d", num_fds); - } - for (i = 0; i < num_poll_list && num_fds > 0; i++) { if ((poll_list[i].revents & (POLLPRI|POLLERR|POLLHUP|POLLNVAL)) == 0) |