Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jan 2010 15:43:14 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r202487 - head/lib/libc/gen
Message-ID:  <201001171543.o0HFhErI068912@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#include <paths.h>
-#include <ttyent.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001171543.o0HFhErI068912>