forked from Imagelibrary/binutils-gdb
PR gdb/8677
* event-loop.c (handle_file_event): Don't handle POLLHUP as error.
This commit is contained in:
@@ -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>
|
2011-05-24 Keith Seitz <keiths@redhat.com>
|
||||||
|
|
||||||
PR breakpoint/12803
|
PR breakpoint/12803
|
||||||
|
|||||||
@@ -759,7 +759,6 @@ handle_file_event (event_data data)
|
|||||||
int mask;
|
int mask;
|
||||||
#ifdef HAVE_POLL
|
#ifdef HAVE_POLL
|
||||||
int error_mask;
|
int error_mask;
|
||||||
int error_mask_returned;
|
|
||||||
#endif
|
#endif
|
||||||
int event_file_desc = data.integer;
|
int event_file_desc = data.integer;
|
||||||
|
|
||||||
@@ -783,22 +782,19 @@ handle_file_event (event_data data)
|
|||||||
if (use_poll)
|
if (use_poll)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_POLL
|
#ifdef HAVE_POLL
|
||||||
|
/* POLLHUP means EOF, but can be combined with POLLIN to
|
||||||
|
signal more data to read. */
|
||||||
error_mask = POLLHUP | POLLERR | POLLNVAL;
|
error_mask = POLLHUP | POLLERR | POLLNVAL;
|
||||||
mask = (file_ptr->ready_mask & file_ptr->mask) |
|
mask = file_ptr->ready_mask & (file_ptr->mask | error_mask);
|
||||||
(file_ptr->ready_mask & error_mask);
|
|
||||||
error_mask_returned = mask & error_mask;
|
|
||||||
|
|
||||||
if (error_mask_returned != 0)
|
if ((mask & (POLLERR | POLLNVAL)) != 0)
|
||||||
{
|
{
|
||||||
/* Work in progress. We may need to tell somebody
|
/* Work in progress. We may need to tell somebody
|
||||||
what kind of error we had. */
|
what kind of error we had. */
|
||||||
if (error_mask_returned & POLLHUP)
|
if (mask & POLLERR)
|
||||||
printf_unfiltered (_("Hangup detected on fd %d\n"),
|
|
||||||
file_ptr->fd);
|
|
||||||
if (error_mask_returned & POLLERR)
|
|
||||||
printf_unfiltered (_("Error detected on fd %d\n"),
|
printf_unfiltered (_("Error detected on fd %d\n"),
|
||||||
file_ptr->fd);
|
file_ptr->fd);
|
||||||
if (error_mask_returned & POLLNVAL)
|
if (mask & POLLNVAL)
|
||||||
printf_unfiltered (_("Invalid or non-`poll'able fd %d\n"),
|
printf_unfiltered (_("Invalid or non-`poll'able fd %d\n"),
|
||||||
file_ptr->fd);
|
file_ptr->fd);
|
||||||
file_ptr->error = 1;
|
file_ptr->error = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user