The logic to optionally exit after a poll() error relies on errno, but
handle_log_reload() does not preserve it.

Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
---
CC: Ian Jackson <ian.jack...@eu.citrix.com>
CC: Wei Liu <wei.l...@citrix.com>
CC: Julien Grall <julien.gr...@arm.com>

For some reason which we haven't tracked down completely yet, an NTP time step
appears to reliably cause xenconsoled to exit, citing "Failure in poll
xs_handle: %d (%s)" with ENOENT.  The NTP time step almost certainly results
in log rotation, but I haven't identifed where the ENOENT came from.
---
 tools/console/daemon/io.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 7e6a886..7e474bb 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -1117,8 +1117,12 @@ void handle_io(void)
                ret = poll(fds, nr_fds, next_timeout ? poll_timeout : -1);
 
                if (log_reload) {
+                       int saved_errno = errno;
+
                        handle_log_reload();
                        log_reload = 0;
+
+                       errno = saved_errno;
                }
 
                /* Abort if poll failed, except for EINTR cases
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to