Deleted Added
full compact
who.c (201033) who.c (202200)
1/*-
2 * Copyright (c) 2002 Tim J. Robbins.
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

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002 Tim J. Robbins.
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

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/usr.bin/who/who.c 201033 2009-12-26 22:36:05Z ed $");
28__FBSDID("$FreeBSD: head/usr.bin/who/who.c 202200 2010-01-13 18:09:54Z ed $");
29
30#include <sys/param.h>
31#include <sys/types.h>
32#include <sys/ioctl.h>
33#include <sys/stat.h>
34
35#include <err.h>
36#include <errno.h>
37#include <langinfo.h>
38#include <limits.h>
39#include <locale.h>
40#include <paths.h>
41#include <pwd.h>
42#include <stdio.h>
43#include <stdlib.h>
44#include <string.h>
45#include <time.h>
46#include <timeconv.h>
29
30#include <sys/param.h>
31#include <sys/types.h>
32#include <sys/ioctl.h>
33#include <sys/stat.h>
34
35#include <err.h>
36#include <errno.h>
37#include <langinfo.h>
38#include <limits.h>
39#include <locale.h>
40#include <paths.h>
41#include <pwd.h>
42#include <stdio.h>
43#include <stdlib.h>
44#include <string.h>
45#include <time.h>
46#include <timeconv.h>
47#define _ULOG_POSIX_NAMES
48#include <ulog.h>
49#include <unistd.h>
47#include <unistd.h>
48#include <utmpx.h>
50
51static void heading(void);
52static void process_utmp(void);
53static void quick(void);
54static void row(struct utmpx *);
55static int ttywidth(void);
56static void usage(void);
57static void whoami(void);

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

104 mflag = 1;
105 argc -= 2;
106 argv += 2;
107 }
108 if (argc > 1)
109 usage();
110
111 if (*argv != NULL) {
49
50static void heading(void);
51static void process_utmp(void);
52static void quick(void);
53static void row(struct utmpx *);
54static int ttywidth(void);
55static void usage(void);
56static void whoami(void);

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

103 mflag = 1;
104 argc -= 2;
105 argv += 2;
106 }
107 if (argc > 1)
108 usage();
109
110 if (*argv != NULL) {
112 if (ulog_setutxfile(UTXI_TTY, *argv) != 0)
111 if (setutxdb(UTXDB_ACTIVE, *argv) != 0)
113 err(1, "%s", *argv);
114 }
115
116 if (qflag)
117 quick();
118 else {
119 if (sflag)
120 Tflag = uflag = 0;

--- 184 unchanged lines hidden ---
112 err(1, "%s", *argv);
113 }
114
115 if (qflag)
116 quick();
117 else {
118 if (sflag)
119 Tflag = uflag = 0;

--- 184 unchanged lines hidden ---