#include "gdb_assert.h"
#include "gdb_select.h"
+/* Tell create_file_handler what events we are interested in.
+ This is used by the select version of the event loop. */
+
+#define GDB_READABLE (1<<1)
+#define GDB_WRITABLE (1<<2)
+#define GDB_EXCEPTION (1<<3)
+
/* Data point to pass to the event handler. */
typedef union event_data
{
struct gdb_timer *next;
timer_handler_func *proc; /* Function to call to do the work */
gdb_client_data client_data; /* Argument to async_handler_func */
- }
-gdb_timer;
+ };
/* List of currently active timers. It is sorted in order of
increasing timers. */
else
{
struct timeval select_timeout;
-
struct timeval *timeout_p;
+
if (block)
timeout_p = gdb_notifier.timeout_valid
? &gdb_notifier.select_timeout : NULL;
gettimeofday (&time_now, NULL);
- timer_ptr = (struct gdb_timer *) xmalloc (sizeof (gdb_timer));
+ timer_ptr = (struct gdb_timer *) xmalloc (sizeof (*timer_ptr));
timer_ptr->when.tv_sec = time_now.tv_sec + delta.tv_sec;
timer_ptr->when.tv_usec = time_now.tv_usec + delta.tv_usec;
/* carry? */