home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!cs.utexas.edu!wupost!uwm.edu!linac!att!att!fang!gator!miles!dennisf
- From: dennisf@miles.com (Dennis Flaherty)
- Subject: w and uptime count LOGIN as a user (+ patch)
- Message-ID: <1993Jan4.125202.23916@miles.com>
- Organization: Miles, Inc. Diagnostics Divis.
- Date: Mon, 4 Jan 1993 12:52:02 GMT
- Lines: 28
-
-
- When I compile the ps package, SYSV_UTMP isn't #defined by default. But
- the w (and hence uptime) command counts "LOGIN" as a user, which it
- shouldn't. Is the following #ifdef really needed? I applied this patch
- and it works for me.
-
- *** w.c~ Tue Oct 13 00:53:21 1992
- --- w.c Tue Dec 29 21:50:15 1992
- ***************
- *** 175,185 ****
- time(&now);
- ut = fopen(_PATH_UTMP, "r");
- while (fread(&utmp, sizeof(utmp), 1, ut)) {
- - #ifdef SYSV_UTMP
- if (utmp.ut_type != USER_PROCESS || utmp.ut_name[0] == '\0')
- - #else
- - if (utmp.ut_name[0] == '\0')
- - #endif
- continue;
- nusers++;
- if (wcmd == 0 || (sel_user &&
- --- 175,181 ----
-
- --
- Dennis T. Flaherty dennisf@Miles.com
- Miles, Inc. dflahert@chekov.helios.nd.edu
- Diagnostics Division (Diabetes B.U.)
- My doctor says Mylanta, but my boss says Alka-Seltzer!
-