From owner-cvs-src@FreeBSD.ORG Fri Oct 3 09:43:06 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B99F61065686; Fri, 3 Oct 2008 09:43:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A7B218FC14; Fri, 3 Oct 2008 09:43:06 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m939h670083386; Fri, 3 Oct 2008 09:43:06 GMT (envelope-from ed@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m939h6UT083385; Fri, 3 Oct 2008 09:43:06 GMT (envelope-from ed@repoman.freebsd.org) Message-Id: <200810030943.m939h6UT083385@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to ed@repoman.freebsd.org using -f From: Ed Schouten Date: Fri, 3 Oct 2008 09:42:50 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/lib/libutil pty.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2008 09:43:06 -0000 ed 2008-10-03 09:42:50 UTC FreeBSD src repository Modified files: lib/libutil pty.c Log: SVN rev 183565 on 2008-10-03 09:42:50Z by ed 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. In theory we could remove a lot of code from openpty() on FreeBSD -CURRENT, because grantpt(), unlockpt() and revoke() are not needed in our implementation. We'd better keep them there. This makes the code still work with older FreeBSD releases and even makes it work on other non-BSD operating systems. I've compiled openpty() on Linux. You only need to remove the revoke() call, because revoke() on Linux always returns -1. Apart from that, it seems to work like it should. Reviewed by: jhb Revision Changes Path 1.23 +15 -23 src/lib/libutil/pty.c