bin/143017: watch(8): fatal: cannot attach to tty
Mark Johnston
markjdb at gmail.com
Mon Mar 12 22:00:34 UTC 2012
The following reply was made to PR bin/143017; it has been noted by GNATS.
From: Mark Johnston <markjdb at gmail.com>
To: Ed Schouten <ed at 80386.nl>
Cc: bug-followup at freebsd.org, dummy at 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 at 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
More information about the freebsd-bugs
mailing list