From 375e1d76efccc934d95b87d9760c63662b9d013b Mon Sep 17 00:00:00 2001 From: nvt-se Date: Fri, 21 Jan 2011 14:19:57 +0000 Subject: [PATCH] Print the error if select fails --- platform/native/contiki-main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/platform/native/contiki-main.c b/platform/native/contiki-main.c index 21bcda454..efd3ca562 100644 --- a/platform/native/contiki-main.c +++ b/platform/native/contiki-main.c @@ -29,7 +29,7 @@ * * This file is part of the Contiki OS * - * $Id: contiki-main.c,v 1.13 2010/06/14 18:58:45 adamdunkels Exp $ + * $Id: contiki-main.c,v 1.14 2011/01/21 14:19:57 nvt-se Exp $ * */ @@ -79,15 +79,14 @@ main(void) n = process_run(); - tv.tv_sec = 0; tv.tv_usec = 1; FD_ZERO(&fds); FD_SET(STDIN_FILENO, &fds); - select(1, &fds, NULL, NULL, &tv); - - if(FD_ISSET(STDIN_FILENO, &fds)) { + if(select(1, &fds, NULL, NULL, &tv) < 0) { + perror("select"); + } else if(FD_ISSET(STDIN_FILENO, &fds)) { char c; if(read(STDIN_FILENO, &c, 1) > 0) { serial_line_input_byte(c);