} else if (strcmp(ubuf.ut_line, tty) == 0) {
} else if (SCMPN(ubuf.ut_line, tty) == 0) {
find_user(name, tty, ttyl)	char *name, *tty;	int ttyl;{	struct utmp ubuf, ubuf1;	int status;	FILE *fd;	char ftty[MAXPATHLEN];	time_t	idle, now;	time(&now);	idle = INT_MAX;	if ((fd = fopen(_PATH_UTMP, "r")) == NULL) {		fprintf(stderr, "talkd: can't read %s.\n", _PATH_UTMP);		return (FAILED);	}#define SCMPN(a, b)	strncmp(a, b, sizeof (a))	status = NOT_HERE;	(void) strlcpy(ftty, _PATH_DEV, sizeof ftty);	while (fread((char *) &ubuf, sizeof ubuf, 1, fd) == 1)		if (SCMPN(ubuf.ut_name, name) == 0) {			if (*tty == '\0') {				/* no particular tty was requested */				struct stat statb;				strlcpy(ftty+sizeof(_PATH_DEV)-1, ubuf.ut_line,				    sizeof(ftty) - sizeof(_PATH_DEV)-1);				if (stat(ftty, &statb) == 0) {					if (!(statb.st_mode & S_IWGRP)) {						if (status == NOT_HERE)							status = PERMISSION_DENIED;					} else if (now - statb.st_atime < idle) {						idle = now - statb.st_atime;						status = SUCCESS;						ubuf1 = ubuf;					}				}			} else if (strcmp(ubuf.ut_line, tty) == 0) {				status = SUCCESS;				break;			}		}	fclose(fd);	if (*tty == '\0' && status == SUCCESS)		strlcpy(tty, ubuf1.ut_line, ttyl);	return (status);}