home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / linux / 22646 < prev    next >
Encoding:
Text File  |  1993-01-04  |  1.2 KB  |  38 lines

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