Date: Mon, 27 Oct 2008 14:22:06 -0400 From: John Baldwin <jhb@freebsd.org> To: Ed Schouten <ed@freebsd.org> Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r184300 - in stable/7/lib: libc/stdlib libutil Message-ID: <200810271422.06751.jhb@freebsd.org> In-Reply-To: <200810262155.m9QLtJG5096815@svn.freebsd.org> References: <200810262155.m9QLtJG5096815@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 26 October 2008 05:55:19 pm Ed Schouten wrote: > Author: ed > Date: Sun Oct 26 21:55:19 2008 > New Revision: 184300 > URL: http://svn.freebsd.org/changeset/base/184300 > > Log: > MFC r183565: > > Small cleanups to openpty(). > > - Pass O_NOCTTY to posix_openpt(2). This makes the implementation work > consistently on implementations that make the PTY the controlling TTY > by default. > > - Call unlockpt() before opening the slave device. POSIX mentions that > de slave device should only be opened after grantpt() and unlockpt() > have been called. > > - Replace some redundant code by a label. > > As a safety net, add a call to revoke() to unlockpt(). All applications > out there use openpty(), explicitly call revoke() or implement their own > PTY allocation routines. Adding the call to unlockpt() won't hurt, but > will prevent foot-shooting. > > Reviewed by: jhb, kib > Approved by: re I would perhaps add a note that the duplicate revoke() in openpty() is only to support legacy libc's with broken unlockpt() routines. We could maybe remove the revoke()/ptsname() from openpty() on 8.x though as all 8.x machines should have a working unlockpt(). -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810271422.06751.jhb>