Subject: Re: Vi still can't remove its own vi-recover files from NFS /var/tmp
To: NetBSD-current Discussion List <>
From: Luke Mewburn <>
List: current-users
Date: 01/26/2004 03:40:20
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Jan 24, 2004 at 10:06:58PM -0500, Greg A. Woods wrote:
  | [ On Sunday, January 25, 2004 at 00:49:11 (+0100), Christian Biere wrot=
e: ]
  | > Well, flex(3) uses isatty() without checking for a character special
  | > device. So, gethostbyname() etc. will trigger a TIOCGETA for
  | > /etc/nsswitch.conf.
  | Ah, of course.  I was a bit quick to give up on looking for a separate
  | isatty() call in the (f)lex generated code when I found the fread() call
  | since they would both occur at the same position in the ktrace output.
  | Adding "%option never-interactive" to the lex source fixes this "proble=
  | Lex should probably also be invoked with '-B' as well.

Good call.

I've added "%option never-interactive" to nslexer.l, which is
sufficient to prevent isatty() from being called.

(Arguably the parser could just be written using fgetln() and
C string parsing instead of yacc & lex.  That's a project for
another day.)

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.3 (NetBSD)