diff -r 9261686d840c tools/console/daemon/io.c --- a/tools/console/daemon/io.c Tue Jun 26 12:40:37 2007 +0100 +++ b/tools/console/daemon/io.c Tue Jun 26 15:36:36 2007 -0400 @@ -766,23 +766,27 @@ void handle_io(void) * for new HV log data as we can with guest */ ret = select(max_fd + 1, &readfds, &writefds, 0, log_hv_fd != -1 ? &timeout : NULL); + if (log_reload) { + handle_log_reload(); + log_reload = 0; + } + + /* Abort if select failed, except for EINTR cases + which indicate a possible log reload */ if (ret == -1) { - if (errno == EINTR) { - if (log_reload) { - handle_log_reload(); - log_reload = 0; - } + if (errno == EINTR) continue; - } dolog(LOG_ERR, "Failure in select: %d (%s)", errno, strerror(errno)); break; } - /* Check for timeout */ + /* Always process HV logs even if not a timeout */ + if (log_hv_fd != -1) + handle_hv_logs(); + + /* Must not check returned FDSET if it was a timeout */ if (ret == 0) { - if (log_hv_fd != -1) - handle_hv_logs(); continue; } @@ -806,10 +810,14 @@ void handle_io(void) } } - if (log_hv_fd != -1) + if (log_hv_fd != -1) { close(log_hv_fd); - if (xc_handle != -1) + log_hv_fd = -1; + } + if (xc_handle != -1) { xc_interface_close(xc_handle); + xc_handle = -1; + } } /*