From bc69c3d0651659922c0ecce20beebdb066e150dd Mon Sep 17 00:00:00 2001 From: Daniel Beer Date: Tue, 13 Sep 2011 14:01:15 +1200 Subject: [PATCH] gdbc: check for Ctrl+C portably. --- gdbc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdbc.c b/gdbc.c index 91fb57c..411a803 100644 --- a/gdbc.c +++ b/gdbc.c @@ -19,7 +19,6 @@ #include #include #include -#include #include "sockets.h" #include "output.h" @@ -325,11 +324,12 @@ static device_status_t gdbc_poll(device_t dev_base) if (!dev->is_running) return DEVICE_STATUS_HALTED; + ctrlc_reset(); len = gdb_peek(&dev->gdb, 50); - if (len < 0) { - if (errno == EINTR) - return DEVICE_STATUS_INTR; + if (ctrlc_check()) + return DEVICE_STATUS_INTR; + if (len < 0) { dev->is_running = 0; return DEVICE_STATUS_ERROR; }