Re: [Xen-devel] [PATCH] xenconsole: Allow non-interactive use

2015-07-24 Thread Ian Campbell
On Fri, 2015-07-24 at 13:36 +0200, Martin Lucina wrote: > On Thursday, 23.07.2015 at 16:23, Ian Campbell wrote: > > On Thu, 2015-07-23 at 17:09 +0200, Martin Lucina wrote: > > > > > > But maybe it would be better to set max_fd = -1 on declaration > > > > and > > > > do > > > > the max dance here

Re: [Xen-devel] [PATCH] xenconsole: Allow non-interactive use

2015-07-24 Thread Martin Lucina
On Thursday, 23.07.2015 at 16:23, Ian Campbell wrote: > On Thu, 2015-07-23 at 17:09 +0200, Martin Lucina wrote: > > > > But maybe it would be better to set max_fd = -1 on declaration and > > > do > > > the max dance here as with the following cases? > > > > Declaring max_fd = -1 is indeed cleare

Re: [Xen-devel] [PATCH] xenconsole: Allow non-interactive use

2015-07-23 Thread Ian Campbell
On Thu, 2015-07-23 at 17:09 +0200, Martin Lucina wrote: > > But maybe it would be better to set max_fd = -1 on declaration and > > do > > the max dance here as with the following cases? > > Declaring max_fd = -1 is indeed clearer, I can do a v2 with that > change if you like. If you are happy

Re: [Xen-devel] [PATCH] xenconsole: Allow non-interactive use

2015-07-23 Thread Martin Lucina
On Thursday, 23.07.2015 at 09:48, Ian Campbell wrote: > On Wed, 2015-07-22 at 19:08 +0200, Martin Lucina wrote: > > If xenconsole is run with stdin closed or redirected to /dev/null, > > console_loop() will return immediately due to failure to read from > > STDIN_FILENO. This patch tests if stdin a

Re: [Xen-devel] [PATCH] xenconsole: Allow non-interactive use

2015-07-23 Thread Wei Liu
On Thu, Jul 23, 2015 at 09:48:50AM +0100, Ian Campbell wrote: > On Wed, 2015-07-22 at 19:08 +0200, Martin Lucina wrote: > > If xenconsole is run with stdin closed or redirected to /dev/null, > > console_loop() will return immediately due to failure to read from > > STDIN_FILENO. This patch tests if

Re: [Xen-devel] [PATCH] xenconsole: Allow non-interactive use

2015-07-23 Thread Ian Campbell
On Wed, 2015-07-22 at 19:08 +0200, Martin Lucina wrote: > If xenconsole is run with stdin closed or redirected to /dev/null, > console_loop() will return immediately due to failure to read from > STDIN_FILENO. This patch tests if stdin and stdout are both connected > to > a TTY and, if not, xencon

[Xen-devel] [PATCH] xenconsole: Allow non-interactive use

2015-07-22 Thread Martin Lucina
If xenconsole is run with stdin closed or redirected to /dev/null, console_loop() will return immediately due to failure to read from STDIN_FILENO. This patch tests if stdin and stdout are both connected to a TTY and, if not, xenconsole will not attempt to read from stdin or modify stdout terminal