Deleted Added
full compact
lastlogin.c (85651) lastlogin.c (89572)
1/*
2 * Copyright (c) 1996 John M. Vinopal
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34#ifndef lint
1/*
2 * Copyright (c) 1996 John M. Vinopal
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34#ifndef lint
35__RCSID("$FreeBSD: head/usr.sbin/lastlogin/lastlogin.c 85651 2001-10-29 00:40:05Z dillon $");
35__RCSID("$FreeBSD: head/usr.sbin/lastlogin/lastlogin.c 89572 2002-01-19 23:20:02Z dillon $");
36__RCSID("$NetBSD: lastlogin.c,v 1.4 1998/02/03 04:45:35 perry Exp $");
37#endif
38
39#include <err.h>
40#include <pwd.h>
41#include <stdio.h>
42#include <stdlib.h>
43#include <time.h>

--- 67 unchanged lines hidden (view full) ---

111}
112
113/* Duplicate the output of last(1) */
114static void
115output(p, l)
116 struct passwd *p;
117 struct lastlog *l;
118{
36__RCSID("$NetBSD: lastlogin.c,v 1.4 1998/02/03 04:45:35 perry Exp $");
37#endif
38
39#include <err.h>
40#include <pwd.h>
41#include <stdio.h>
42#include <stdlib.h>
43#include <time.h>

--- 67 unchanged lines hidden (view full) ---

111}
112
113/* Duplicate the output of last(1) */
114static void
115output(p, l)
116 struct passwd *p;
117 struct lastlog *l;
118{
119 time_t t = int_to_time(l->ll_time);
119 time_t t = _int_to_time(l->ll_time);
120 printf("%-*.*s %-*.*s %-*.*s %s",
121 UT_NAMESIZE, UT_NAMESIZE, p->pw_name,
122 UT_LINESIZE, UT_LINESIZE, l->ll_line,
123 UT_HOSTSIZE, UT_HOSTSIZE, l->ll_host,
124 (l->ll_time) ? ctime(&t) : "Never logged in\n");
125}
126
127static void
128usage()
129{
130 fprintf(stderr, "usage: lastlogin [user ...]\n");
131 exit(1);
132}
120 printf("%-*.*s %-*.*s %-*.*s %s",
121 UT_NAMESIZE, UT_NAMESIZE, p->pw_name,
122 UT_LINESIZE, UT_LINESIZE, l->ll_line,
123 UT_HOSTSIZE, UT_HOSTSIZE, l->ll_host,
124 (l->ll_time) ? ctime(&t) : "Never logged in\n");
125}
126
127static void
128usage()
129{
130 fprintf(stderr, "usage: lastlogin [user ...]\n");
131 exit(1);
132}