This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

HAVE_POLL is not enough


With the gdb cvs tree of 2000-02-19, on m68k-motorola-sys, configure
correctly detect  that we have `poll', but gdb incorrectly assumes that
`poll' can be used to wait for `stdin'.  On m68k-motorola-sysv, tty's
are not stream-based and not `poll'able.  Should the configure test
be enhanced ? I don't think so if we need to run a target program to check
that, because it would fail if we cross-compile gdb, but if it can be
determined by other ways, like the presence of some constants in some
header files then I would agree.  We could also always compile in the `poll'
version if HAVE_POLL, but switch to the the fall-back method at run time if
poll fails with POLLNVAL.

Meanwhile here is a small patch that at least tell the user what happened.

Mon Feb 21 12:39:44 2000  Philippe De Muyter  <phdm@macqel.be>

	* event-loop.c (handle_file_event): Issue an error message when
	poll fails.

--- ./gdb/event-loop.c	Mon Feb 21 12:35:54 2000
+++ ./gdb/event-loop.c	Sun Feb 20 19:04:50 2000
@@ -697,12 +697,12 @@ handle_file_event (int event_file_desc)
 	    {
 	      /* 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)
-	         printf_unfiltered ("Error detected on fd %d\n", file_ptr->fd);
-	         if (error_mask_returned & POLLNVAL)
-	         printf_unfiltered ("Invalid fd %d\n", file_ptr->fd); */
+	      if (error_mask_returned & POLLHUP)
+	        printf_unfiltered ("Hangup detected on fd %d\n", file_ptr->fd);
+	      if (error_mask_returned & POLLERR)
+	        printf_unfiltered ("Error detected on fd %d\n", file_ptr->fd);
+	      if (error_mask_returned & POLLNVAL)
+	        printf_unfiltered ("Invalid or non-`poll'able fd %d\n", file_ptr->fd);
 	      file_ptr->error = 1;
 	    }
 	  else

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]