tools/xenconsoled: Preserve errno while rotating logfile handles
PATCH 1/1 tools/xenconsoled: Preserve errno while rotating logfile handles
The logic to optionally exit after a poll() error relies on errno, but handle_log_reload() does not preserve it.
---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Julien Grall <[email protected]>
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 pollxs_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(+)
tools/console/daemon/io.c +4 -0
@@ -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
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Andrew Cooper writes ("[PATCH for-4.9] tools/xenconsoled: Preserve errno while rotating logfile handles"):
Quoted 4 lines
The logic to optionally exit after a
poll()error relies on errno, buthandle_log_reload()does not preserve it.Signed-off-by Andrew Cooper <[email protected]>
This is an obvious bugfix and good 4.9 material IMO.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 9 lines · Ian Jackson
Andrew Cooper writes ("[PATCH for-4.9]
tools/xenconsoled: Preserve errno while rotating logfile handles"):Quoted 4 lines
The logic to optionally exit after a
poll()error relies on errno, buthandle_log_reload()does not preserve it.Signed-off-by Andrew Cooper <[email protected]>Acked-by Ian Jackson <[email protected]>This is an obvious bugfix and good 4.9 material IMO.
Cheers,
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel