diff --git a/timeoutd.c b/timeoutd.c index 7c46385..4abff5f 100644 --- a/timeoutd.c +++ b/timeoutd.c @@ -341,10 +341,8 @@ void read_wtmp() if (tm->tm_year != now.tm_year || tm->tm_yday != now.tm_yday) break; -#ifndef SUNOS if (ut.ut_type == USER_PROCESS || ut.ut_type == DEAD_PROCESS || ut.ut_type == UT_UNKNOWN || /* SA 19940703 */ ut.ut_type == LOGIN_PROCESS || ut.ut_type == BOOT_TIME) -#endif { if ((ut_list_p = (struct ut_list *) malloc(sizeof(struct ut_list))) == NULL) @@ -379,13 +377,8 @@ void free_wtmp() tm = localtime(&(wtmplist->elem.ut_time)); printf("%d:%d %s %s %s\n", tm->tm_hour, tm->tm_min, wtmplist->elem.ut_line, wtmplist->elem.ut_user, -#ifndef SUNOS wtmplist->elem.ut_type == - LOGIN_PROCESS ? "login" : wtmplist->elem.ut_type == BOOT_TIME ? "reboot" : "logoff" -#else - "" -#endif - ); + LOGIN_PROCESS ? "login" : wtmplist->elem.ut_type == BOOT_TIME ? "reboot" : "logoff"); #endif ut_list_p = wtmplist; wtmplist = wtmplist->next; @@ -667,11 +660,7 @@ char *user; while (login_p) { /* For each login on a matching tty find its logout */ - if ( -#ifndef SUNOS - login_p->elem.ut_type == USER_PROCESS && -#endif - !strncmp(login_p->elem.ut_user, user, 8) + if (login_p->elem.ut_type == USER_PROCESS && !strncmp(login_p->elem.ut_user, user, 8) && chkmatch(login_p->elem.ut_line, config[configline]->ttys)) { #ifdef DEBUG_WTMP struct tm *tm; @@ -689,12 +678,10 @@ char *user; * but is better than marking them as logged in for the time the machine * was down. */ -#ifndef SUNOS if (logout_p->elem.ut_type == BOOT_TIME) { logout_p = prev_p; break; } -#endif if ( /*logout_p->elem.ut_type == DEAD_PROCESS && */ !strncmp(login_p->elem.ut_line, logout_p->elem.ut_line, UT_LINESIZE)) break; @@ -882,12 +869,10 @@ void check_idle() short aktconfigline = -1; /* -1 if user is in config; >0 if he's not in config, * is handled in an other way */ pstat = &status; /* point to status structure */ -#ifndef SUNOS sprintf(path, "/proc/%d", utmpp->ut_pid); if (utmpp->ut_type != USER_PROCESS || !utmpp->ut_user[0] || /* if not user process */ stat(path, pstat)) /* or if proc doesn't exist */ return; /* skip the utmp entry */ -#endif strncpy(user, utmpp->ut_user, sizeof(user) - 1); /* get user name */ user[sizeof(user) - 1] = '\0'; /* null terminate user name string */ @@ -1033,9 +1018,6 @@ char *host; { int tty; pid_t cpid; -#ifdef SUNOS - struct passwd *pw; -#endif if (chk_xsession(dev, host) && !chk_xterm(dev, host)) { killit_xsession(utmpp->ut_pid, user, host);