Date: Mon, 12 Mar 2012 22:00:33 GMT From: Mark Johnston <markjdb@gmail.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/143017: watch(8): fatal: cannot attach to tty Message-ID: <201203122200.q2CM0XuA082140@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/143017; it has been noted by GNATS. From: Mark Johnston <markjdb@gmail.com> To: Ed Schouten <ed@80386.nl> Cc: bug-followup@freebsd.org, dummy@smtp.ru Subject: Re: bin/143017: watch(8): fatal: cannot attach to tty Date: Mon, 12 Mar 2012 17:52:36 -0400 On Mon, Mar 12, 2012 at 5:27 PM, Ed Schouten <ed@80386.nl> wrote: > Sure, but in that case you can simply use isatty() to distinguish the > special treatment. What I mean is that you can only call watch(8) by > passing the TTY used on the command line. Ok, fair enough. I replaced opt_interactive with isatty(std_out) checks. One check was unnecessary - the line with a FD_ISSET check. I also added a check in unset_tty() so that the terminal doesn't break if we bail with ^C. So the difference now is that in non-interactive mode, we're not interested in stdin, and the tty has to be passed on the command line. > Also I see you've simplified the code that dynamically scales the input > buffer size. Though I think that's a good idea, I do think we should > increase BUF_SIZE to something higher. Setting it to 4 KB or something > shouldn't harm, right? Yeah, good point. I've attached the regenerated patch. -Mark
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203122200.q2CM0XuA082140>