From e482118106c63edd3c9f6647e4232e90b4c16066 Mon Sep 17 00:00:00 2001 From: oharboe Date: Mon, 25 Feb 2008 07:50:03 +0000 Subject: - using ERROR_COMMAND_SYNTAX_ERROR to print syntax in a couple of places - some more flash cleanup of checking halted state - moved output handler into options.c - very slightly tweaked server.c to make it a bit more compatible with eCos - retired arch_state. Not quite sure how I managed to leave that out last time. git-svn-id: svn://svn.berlios.de/openocd/trunk@338 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/server/server.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/server/server.c') diff --git a/src/server/server.c b/src/server/server.c index b0ad834a..6e43cf7c 100644 --- a/src/server/server.c +++ b/src/server/server.c @@ -277,7 +277,9 @@ int server_loop(command_context_t *command_context) FD_SET(fileno(stdin), &read_fds); #endif - if ((retval = select(fd_max + 1, &read_fds, NULL, NULL, &tv)) == -1) + retval = select(fd_max + 1, &read_fds, NULL, NULL, &tv); + + if (retval == -1) { #ifdef _WIN32 @@ -293,7 +295,9 @@ int server_loop(command_context_t *command_context) #else if (errno == EINTR) + { FD_ZERO(&read_fds); + } else { ERROR("error during select: %s", strerror(errno)); @@ -309,6 +313,7 @@ int server_loop(command_context_t *command_context) /* do regular tasks after at most 100ms */ tv.tv_sec = 0; tv.tv_usec = 10000; + FD_ZERO(&read_fds); /* eCos leaves read_fds unchanged in this case! */ } for (service = services; service; service = service->next) @@ -318,7 +323,9 @@ int server_loop(command_context_t *command_context) && (FD_ISSET(service->fd, &read_fds))) { if (service->max_connections > 0) + { add_connection(service, command_context); + } else { struct sockaddr_in sin; -- cgit v1.2.3