[BACK]Return to rwho.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rwho

Diff for /src/usr.bin/rwho/Attic/rwho.c between version 1.11 and 1.12

version 1.11, 2001/01/31 20:12:49 version 1.12, 2001/02/17 17:35:14
Line 44 
Line 44 
 static char rcsid[] = "$OpenBSD$";  static char rcsid[] = "$OpenBSD$";
 #endif /* not lint */  #endif /* not lint */
   
   #include <sys/types.h>
 #include <sys/param.h>  #include <sys/param.h>
 #include <sys/file.h>  #include <sys/file.h>
 #include <dirent.h>  #include <dirent.h>
Line 52 
Line 53 
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
 #include <stdlib.h>  #include <stdlib.h>
   #include <time.h>
 #include <utmp.h>  #include <utmp.h>
 #include <vis.h>  #include <vis.h>
 #include <err.h>  #include <err.h>
Line 75 
Line 77 
  */   */
 #define down(w,now)     ((now) - (w)->wd_recvtime > 11 * 60)  #define down(w,now)     ((now) - (w)->wd_recvtime > 11 * 60)
   
 char    *ctime();  
 time_t  now;  time_t  now;
 int     aflg;  int     aflg;
   
Line 100 
Line 101 
         register struct whoent *we;          register struct whoent *we;
         register struct myutmp *mp;          register struct myutmp *mp;
         int f, n, i;          int f, n, i;
         time_t time();  
         int nhosts = 0;          int nhosts = 0;
   
         while ((ch = getopt(argc, argv, "a")) != -1)          while ((ch = getopt(argc, argv, "a")) != -1)
Line 146 
Line 146 
                                 we++;                                  we++;
                                 continue;                                  continue;
                         }                          }
                         if (nusers >= NUSERS) {                          if (nusers >= NUSERS)
                                 printf("too many users\n");                                  errx(1, "too many users");
                                 exit(1);  
                         }  
                         mp->myutmp = we->we_utmp; mp->myidle = we->we_idle;                          mp->myutmp = we->we_utmp; mp->myidle = we->we_idle;
                         (void) strncpy(mp->myhost, w->wd_hostname,                          (void) strncpy(mp->myhost, w->wd_hostname,
                             sizeof(mp->myhost)-1);                              sizeof(mp->myhost)-1);
Line 178 
Line 176 
                 strvis(vis_user, mp->myutmp.out_name, VIS_CSTYLE);                  strvis(vis_user, mp->myutmp.out_name, VIS_CSTYLE);
                 printf("%-*.*s %-*s %.12s",                  printf("%-*.*s %-*s %.12s",
                    UT_NAMESIZE, UT_NAMESIZE, vis_user,                     UT_NAMESIZE, UT_NAMESIZE, vis_user,
                    width,                     width, buf,
                    buf,  
                    ctime((time_t *)&mp->myutmp.out_time)+4);                     ctime((time_t *)&mp->myutmp.out_time)+4);
                 mp->myidle /= 60;                  mp->myidle /= 60;
                 if (mp->myidle) {                  if (mp->myidle) {

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12