diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-02-25 07:50:03 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-02-25 07:50:03 +0000 |
commit | e482118106c63edd3c9f6647e4232e90b4c16066 (patch) | |
tree | 3e0e8e1c4a135b5631a7ba32f383f844576cfc30 /src/server | |
parent | 815c3b353307796fb4d86a1880679dacaed00b6e (diff) | |
download | riscv-openocd-e482118106c63edd3c9f6647e4232e90b4c16066.zip riscv-openocd-e482118106c63edd3c9f6647e4232e90b4c16066.tar.gz riscv-openocd-e482118106c63edd3c9f6647e4232e90b4c16066.tar.bz2 |
- 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
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/server.c | 9 | ||||
-rw-r--r-- | src/server/telnet_server.c | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/server/server.c b/src/server/server.c index b0ad834..6e43cf7 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; diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c index b40daca..899902a 100644 --- a/src/server/telnet_server.c +++ b/src/server/telnet_server.c @@ -121,13 +121,11 @@ int telnet_target_callback_event_handler(struct target_s *target, enum target_ev switch (event) { case TARGET_EVENT_HALTED: - command_print(cmd_ctx, "Target %i halted", get_num_by_target(target)); target_arch_state(target); if (!t_con->suppress_prompt) telnet_prompt(connection); break; case TARGET_EVENT_RESUMED: - command_print(cmd_ctx, "Target %i resumed", get_num_by_target(target)); if (!t_con->suppress_prompt) telnet_prompt(connection); break; |