diff options
author | Andreas Schwab <schwab@linux-m68k.org> | 2011-05-25 07:59:04 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@linux-m68k.org> | 2011-05-25 07:59:04 +0000 |
commit | 652c71b432424e029c32cd7c4938a84cbcc5813e (patch) | |
tree | b7056e2a494f81d43f968f38d18107cdbee08065 /gdb | |
parent | 1706a06f9e3f4dbdc5f516e3631d44a081e8b95e (diff) | |
download | binutils-gdb-652c71b432424e029c32cd7c4938a84cbcc5813e.tar.gz |
PR gdb/8677
* event-loop.c (handle_file_event): Don't handle POLLHUP as error.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/event-loop.c | 16 |
2 files changed, 11 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 409426360a7..81cdddcfe13 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-05-25 Andreas Schwab <schwab@redhat.com> + + PR gdb/8677 + * event-loop.c (handle_file_event): Don't handle POLLHUP as error. + 2011-05-24 Keith Seitz <keiths@redhat.com> PR breakpoint/12803 diff --git a/gdb/event-loop.c b/gdb/event-loop.c index 617835feb05..b6702f868d3 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -759,7 +759,6 @@ handle_file_event (event_data data) int mask; #ifdef HAVE_POLL int error_mask; - int error_mask_returned; #endif int event_file_desc = data.integer; @@ -783,22 +782,19 @@ handle_file_event (event_data data) if (use_poll) { #ifdef HAVE_POLL + /* POLLHUP means EOF, but can be combined with POLLIN to + signal more data to read. */ error_mask = POLLHUP | POLLERR | POLLNVAL; - mask = (file_ptr->ready_mask & file_ptr->mask) | - (file_ptr->ready_mask & error_mask); - error_mask_returned = mask & error_mask; + mask = file_ptr->ready_mask & (file_ptr->mask | error_mask); - if (error_mask_returned != 0) + if ((mask & (POLLERR | POLLNVAL)) != 0) { /* Work in progress. We may need to tell somebody what kind of error we had. */ - if (error_mask_returned & POLLHUP) - printf_unfiltered (_("Hangup detected on fd %d\n"), - file_ptr->fd); - if (error_mask_returned & POLLERR) + if (mask & POLLERR) printf_unfiltered (_("Error detected on fd %d\n"), file_ptr->fd); - if (error_mask_returned & POLLNVAL) + if (mask & POLLNVAL) printf_unfiltered (_("Invalid or non-`poll'able fd %d\n"), file_ptr->fd); file_ptr->error = 1; |