From owner-svn-src-all@FreeBSD.ORG Sun Jan 17 15:43:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0431B106566B; Sun, 17 Jan 2010 15:43:15 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E72E78FC1A; Sun, 17 Jan 2010 15:43:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0HFhE3S068914; Sun, 17 Jan 2010 15:43:14 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0HFhErI068912; Sun, 17 Jan 2010 15:43:14 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001171543.o0HFhErI068912@svn.freebsd.org> From: Ed Schouten Date: Sun, 17 Jan 2010 15:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202487 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jan 2010 15:43:15 -0000 Author: ed Date: Sun Jan 17 15:43:14 2010 New Revision: 202487 URL: http://svn.freebsd.org/changeset/base/202487 Log: Simplify ttyslot(3). After comparing how other systems deal with utmp/utmpx, I noticed many systems don't even care about ttyslot(3) anymore, since utmpx doesn't use TTY slots anyway. We don't provide any tools to access old utmp files anymore, so there is no use in letting applications write to a proper offset within the utmp file. Just let ttyslot(3) always return 0, which seems to be the default behaviour on operating systems like Linux as well. Modified: head/lib/libc/gen/ttyslot.c Modified: head/lib/libc/gen/ttyslot.c ============================================================================== --- head/lib/libc/gen/ttyslot.c Sun Jan 17 15:21:24 2010 (r202486) +++ head/lib/libc/gen/ttyslot.c Sun Jan 17 15:43:14 2010 (r202487) @@ -33,35 +33,11 @@ static char sccsid[] = "@(#)ttyslot.c 8. #include __FBSDID("$FreeBSD$"); -#include -#include -#include -#include -#include - int __ttyslot(void) { - struct ttyent *ttyp; - int slot; - int cnt; - char *name; - setttyent(); - for (cnt = 0; cnt < 3; ++cnt) - if ( (name = ttyname(cnt)) ) { - if (strncmp(name, _PATH_DEV, sizeof _PATH_DEV - 1) != 0) - break; - name += sizeof _PATH_DEV - 1; - for (slot = 1; (ttyp = getttyent()); ++slot) - if (!strcmp(ttyp->ty_name, name)) { - endttyent(); - return(slot); - } - break; - } - endttyent(); - return(0); + return (0); } __sym_compat(ttyslot, __ttyslot, FBSD_1.0);