View | Details | Raw Unified | Return to bug 168844
Collapse All | Expand All

(-)usr.bin/last/last.c (+8 lines)
Lines 64-69 Link Here
64
64
65
typedef struct arg {
65
typedef struct arg {
66
	char	*name;				/* argument */
66
	char	*name;				/* argument */
67
#define	REBOOT_TYPE	-1
67
#define	HOST_TYPE	-2
68
#define	HOST_TYPE	-2
68
#define	TTY_TYPE	-3
69
#define	TTY_TYPE	-3
69
#define	USER_TYPE	-4
70
#define	USER_TYPE	-4
Lines 180-185 Link Here
180
	if (argc) {
181
	if (argc) {
181
		setlinebuf(stdout);
182
		setlinebuf(stdout);
182
		for (argv += optind; *argv; ++argv) {
183
		for (argv += optind; *argv; ++argv) {
184
			if (strcmp(*argv, "reboot") == 0)
185
				addarg(REBOOT_TYPE, *argv);
183
#define	COMPATIBILITY
186
#define	COMPATIBILITY
184
#ifdef	COMPATIBILITY
187
#ifdef	COMPATIBILITY
185
			/* code to allow "last p5" to work */
188
			/* code to allow "last p5" to work */
Lines 391-396 Link Here
391
394
392
	for (step = arglist; step; step = step->next)
395
	for (step = arglist; step; step = step->next)
393
		switch(step->type) {
396
		switch(step->type) {
397
		case REBOOT_TYPE:
398
			if (bp->ut_type == BOOT_TIME ||
399
			    bp->ut_type == SHUTDOWN_TIME)
400
				return (YES);
401
			break;
394
		case HOST_TYPE:
402
		case HOST_TYPE:
395
			if (!strcasecmp(step->name, bp->ut_host))
403
			if (!strcasecmp(step->name, bp->ut_host))
396
				return (YES);
404
				return (YES);

Return to bug 168844