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

Diff for /src/usr.bin/who/who.c between version 1.29 and 1.30

version 1.29, 2020/08/27 15:20:31 version 1.30, 2021/07/12 15:09:20
Line 113 
Line 113 
         if (show_quick) {          if (show_quick) {
                 only_current_term = show_term = show_idle = show_labels = 0;                  only_current_term = show_term = show_idle = show_labels = 0;
         }          }
   
         if (show_term)          if (show_term)
                 hostwidth -= 2;                  hostwidth -= 2;
         if (show_idle)          if (show_idle)
Line 123 
Line 123 
                 output_labels();                  output_labels();
   
         if (unveil(_PATH_UTMP, "r") == -1)          if (unveil(_PATH_UTMP, "r") == -1)
                 err(1, "unveil");                  err(1, "unveil %s", _PATH_UTMP);
         if (show_term || show_idle) {          if (show_term || show_idle) {
                 if (unveil(_PATH_DEV, "r") == -1)                  if (unveil(_PATH_DEV, "r") == -1)
                         err(1, "unveil");                          err(1, "unveil %s", _PATH_DEV);
         }          }
         switch (argc) {          switch (argc) {
         case 0:                                 /* who */          case 0:                                 /* who */
Line 138 
Line 138 
                         who_am_i(ufp);                          who_am_i(ufp);
                 } else if (show_quick) {                  } else if (show_quick) {
                         int count = 0;                          int count = 0;
   
                         while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) {                          while (fread((char *)&usr, sizeof(usr), 1, ufp) == 1) {
                                 if (*usr.ut_name && *usr.ut_line) {                                  if (*usr.ut_name && *usr.ut_line) {
                                         (void)printf("%-*.*s ", NAME_WIDTH,                                          (void)printf("%-*.*s ", NAME_WIDTH,
Line 159 
Line 159 
                 break;                  break;
         case 1:                                 /* who utmp_file */          case 1:                                 /* who utmp_file */
                 if (unveil(*argv, "r") == -1)                  if (unveil(*argv, "r") == -1)
                         err(1, "unveil");                          err(1, "unveil %s", *argv);
                 if (pledge("stdio rpath getpw", NULL) == -1)                  if (pledge("stdio rpath getpw", NULL) == -1)
                         err(1, "pledge");                          err(1, "pledge");
                 ufp = file(*argv);                  ufp = file(*argv);

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30