From owner-svn-src-stable-7@FreeBSD.ORG Mon Oct 27 19:21:37 2008 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9FB3106566C; Mon, 27 Oct 2008 19:21:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6C7D78FC25; Mon, 27 Oct 2008 19:21:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [IPv6:::1]) (authenticated bits=0) by server.baldwin.cx (8.14.3/8.14.3) with ESMTP id m9RJLJMQ014395; Mon, 27 Oct 2008 15:21:31 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Ed Schouten Date: Mon, 27 Oct 2008 14:22:06 -0400 User-Agent: KMail/1.9.7 References: <200810262155.m9QLtJG5096815@svn.freebsd.org> In-Reply-To: <200810262155.m9QLtJG5096815@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200810271422.06751.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:::1]); Mon, 27 Oct 2008 15:21:31 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/8511/Mon Oct 27 14:23:52 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx 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 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2008 19:21:38 -0000 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