From 47ae443fa5f3b739136606b138c2a4bc9b904974 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 17 Jan 2010 15:43:14 +0000 Subject: 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. --- lib/libc/gen/ttyslot.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'lib/libc/gen') diff --git a/lib/libc/gen/ttyslot.c b/lib/libc/gen/ttyslot.c index b2fac7c..1de0837 100644 --- a/lib/libc/gen/ttyslot.c +++ b/lib/libc/gen/ttyslot.c @@ -33,35 +33,11 @@ static char sccsid[] = "@(#)ttyslot.c 8.1 (Berkeley) 6/4/93"; #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); -- cgit v1.1