diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2010-07-04 10:17:26 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2010-07-04 10:17:26 +0000 |
commit | b1374a39b073f30cfbdd0777a47d4de7aec33e9f (patch) | |
tree | 3bc02655d68bb8951073ef9a2fd5b1728808e288 | |
parent | a0675c8e79c18a7319eb92eef1ce37794227b4f9 (diff) |
Remove the non-standard, commented out, -c option.
OK tedu@ jmc@ deraadt@
-rw-r--r-- | usr.sbin/ac/Makefile | 14 | ||||
-rw-r--r-- | usr.sbin/ac/ac.8 | 33 | ||||
-rw-r--r-- | usr.sbin/ac/ac.c | 54 |
3 files changed, 4 insertions, 97 deletions
diff --git a/usr.sbin/ac/Makefile b/usr.sbin/ac/Makefile index 182a4f00b9c..5a9592bb09f 100644 --- a/usr.sbin/ac/Makefile +++ b/usr.sbin/ac/Makefile @@ -1,18 +1,6 @@ -# $OpenBSD: Makefile,v 1.2 1997/09/21 11:43:06 deraadt Exp $ +# $OpenBSD: Makefile,v 1.3 2010/07/04 10:17:25 millert Exp $ PROG= ac MAN= ac.8 -# If "CONSOLE_TTY" is not defined, this program is compatible with the -# traditional implementation (using SunOS 4.x as the sample traditional -# implementation). This is the default. -# -# If "CONSOLE_TTY" is defined, it must be defined to the appropriate -# console name, e.g. "vga". Additionally, the various commented-out -# sections of the man page should be uncommented. This is not the -# default because of the inability to detect the proper console name -# easily, especially on m68k systems, which can share binaries. -# -#CFLAGS+=-DCONSOLE_TTY=\"vga\" - .include <bsd.prog.mk> diff --git a/usr.sbin/ac/ac.8 b/usr.sbin/ac/ac.8 index 8da2baeff0a..fca37966f6b 100644 --- a/usr.sbin/ac/ac.8 +++ b/usr.sbin/ac/ac.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ac.8,v 1.20 2009/04/26 13:10:20 tobias Exp $ +.\" $OpenBSD: ac.8,v 1.21 2010/07/04 10:17:25 millert Exp $ .\" .\" Copyright (c) 1994 Simon J. Gerraty .\" Copyright (c) 1994 Christopher G. Demetriou @@ -29,7 +29,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: April 26 2009 $ +.Dd $Mdocdate: July 4 2010 $ .Dt AC 8 .Os .Sh NAME @@ -38,7 +38,6 @@ .Sh SYNOPSIS .Nm ac .Op Fl dp -.\".Op Fl c Ar console .Op Fl t Ar tty .Op Fl w Ar wtmp .Op Ar user ... @@ -59,14 +58,6 @@ The options are as follows: .Bl -tag -width Ds .It Fl d Display the connect times in 24 hour chunks. -.\" .It Fl c Ar console -.\" Use -.\" .Ar console -.\" as the name of the device that local X sessions (ut_host of ":0.0") -.\" originate from. If any login has been recorded on -.\" .Ar console -.\" then these X sessions are ignored unless COMPAT_SUNOS was defined at -.\" compile time. .It Fl p Print individual users' totals. .It Fl t Ar tty @@ -159,23 +150,3 @@ This version of was written for .Nx 0.9a from the specification provided by various systems' manual pages. -.\" .Sh NOTES -.\" If COMPAT_SUNOS is defined -.\" .Nm ac -.\" ignores the fact that entries with ut_host of ":0.0" are not real -.\" login sessions. Normally such entries are ignored except in the case -.\" of a user being logged in when the -.\" .Pa wtmp -.\" file was rotated, in which case a login with ut_host of ":0.0" may -.\" appear without any preceding console logins. -.\" If no one is logged in on the console, the user is deemed to have -.\" logged in on at the earliest time stamp found in -.\" .Pa wtmp . -.\" Use of -.\" .Pa console -.\" allows -.\" .Nm ac -.\" to identify and correctly process a logout for the user. The default -.\" value for -.\" .Pa console -.\" is usually correct at compile time. diff --git a/usr.sbin/ac/ac.c b/usr.sbin/ac/ac.c index a0e7ae781e6..e5750f1422a 100644 --- a/usr.sbin/ac/ac.c +++ b/usr.sbin/ac/ac.c @@ -55,9 +55,6 @@ struct tty_list { /* * globals - yes yuk */ -#ifdef CONSOLE_TTY -static char *Console = CONSOLE_TTY; -#endif static time_t Total = 0; static time_t FirstTime = 0; static int Flags = 0; @@ -155,24 +152,6 @@ do_tty(char *name) return def_ret; } -#ifdef CONSOLE_TTY -/* - * is someone logged in on Console? - */ -int -on_console(struct utmp_list *head) -{ - struct utmp_list *up; - - for (up = head; up; up = up->next) { - if (strncmp(up->usr.ut_line, Console, - sizeof (up->usr.ut_line)) == 0) - return 1; - } - return 0; -} -#endif - /* * update user's login time */ @@ -210,20 +189,13 @@ main(int argc, char *argv[]) int c; fp = NULL; - while ((c = getopt(argc, argv, "Dc:dpt:w:")) != -1) { + while ((c = getopt(argc, argv, "Ddpt:w:")) != -1) { switch (c) { #ifdef DEBUG case 'D': Debug++; break; #endif - case 'c': -#ifdef CONSOLE_TTY - Console = optarg; -#else - usage(); /* XXX */ -#endif - break; case 'd': Flags |= AC_D; break; @@ -378,25 +350,6 @@ log_in(struct utmp_list *head, struct utmp *up) * logged in, at the start of the wtmp file. */ -#ifdef CONSOLE_TTY - if (up->ut_host[0] == ':') { - /* - * SunOS 4.0.2 does not treat ":0.0" as special but we - * do. - */ - if (on_console(head)) - return head; - /* - * ok, no recorded login, so they were here when wtmp - * started! Adjust ut_time! - */ - up->ut_time = FirstTime; - /* - * this allows us to pick the right logout - */ - strlcpy(up->ut_line, Console, sizeof (up->ut_line)); - } -#endif /* * If we are doing specified ttys only, we ignore * anything else. @@ -525,11 +478,6 @@ usage(void) { extern char *__progname; (void)fprintf(stderr, "usage: " -#ifdef CONSOLE_TTY - "%s [-dp] [-c console] [-t tty] [-w wtmp] [user ...]\n", - __progname); -#else "%s [-dp] [-t tty] [-w wtmp] [user ...]\n", __progname); -#endif exit(1); } |