[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 1/2] tools/console: reset tty when xenconsole fails



Anthony Liguori writes ("Re: [Xen-devel] [PATCH v2 1/2] tools/console: reset 
tty when xenconsole fails"):
> On Tue, Mar 18, 2014 at 11:00 AM, Ian Jackson <ian.jackson@xxxxxxxxxxxxx> 
> wrote:
...
> >         init_term(spty, &attr);
> > -       init_term(STDIN_FILENO, &attr);
> > +       init_term(STDIN_FILENO, &stdin_old_attr);
> > +       atexit(restore_term_stdin); /* if this fails, oh dear */
> 
> You may want to consider using a signal handler too.  atexit() isn't
> called when exiting due to SIGTERM or SIGSEGV.

That's would be quite exciting.  I doubt tcsetattr is async-signal
safe.  We could prat about with sigprocmask and pselect perhaps, but
that's more than I want to do right now (or, indeed, soon).

In practice, the shell will normally restore the terminal in this
situation.

Ian.

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.