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

Diff for /src/usr.bin/at/at.c between version 1.30.2.1 and 1.31

version 1.30.2.1, 2003/03/18 04:06:47 version 1.31, 2002/11/20 19:57:19
Line 43 
Line 43 
 #include <err.h>  #include <err.h>
 #include <errno.h>  #include <errno.h>
 #include <fcntl.h>  #include <fcntl.h>
 #include <limits.h>  
 #include <locale.h>  #include <locale.h>
 #include <pwd.h>  #include <pwd.h>
 #include <signal.h>  #include <signal.h>
Line 409 
Line 408 
 }  }
   
 static void  static void
 print_job(struct atjob *job, int n, int shortformat)  print_job(struct atjob *job, int n, struct stat *st, int shortformat)
 {  {
         struct passwd *pw;          struct passwd *pw;
         struct tm runtime;          struct tm runtime;
Line 424 
Line 423 
                 (void)printf("%ld.%c\t%s\n", (long)job->runtimer,                  (void)printf("%ld.%c\t%s\n", (long)job->runtimer,
                     job->queue, timestr);                      job->queue, timestr);
         } else {          } else {
                 pw = getpwuid(job->uid);                  pw = getpwuid(st->st_uid);
                 /* Rank hack shamelessly stolen from lpq */                  /* Rank hack shamelessly stolen from lpq */
                 if (n / 10 == 1)                  if (n / 10 == 1)
                         printf("%3d%-5s", n,"th");                          printf("%3d%-5s", n,"th");
Line 434 
Line 433 
                 (void)printf("%-21.18s%-11.8s%10ld.%c   %c%s\n",                  (void)printf("%-21.18s%-11.8s%10ld.%c   %c%s\n",
                     timestr, pw ? pw->pw_name : "???",                      timestr, pw ? pw->pw_name : "???",
                     (long)job->runtimer, job->queue, job->queue,                      (long)job->runtimer, job->queue, job->queue,
                     (S_IXUSR & job->mode) ? "" : " (done)");                      (S_IXUSR & st->st_mode) ? "" : " (done)");
         }          }
 }  }
   
Line 549 
Line 548 
                         err(EXIT_FAILURE, "malloc");                          err(EXIT_FAILURE, "malloc");
                 job->runtimer = runtimer;                  job->runtimer = runtimer;
                 job->ctime = stbuf.st_ctime;                  job->ctime = stbuf.st_ctime;
                 job->uid = stbuf.st_uid;  
                 job->mode = stbuf.st_mode;  
                 job->queue = queue;                  job->queue = queue;
                 if (numjobs == maxjobs) {                  if (numjobs == maxjobs) {
                     maxjobs *= 2;                      maxjobs *= 2;
Line 580 
Line 577 
                     "Job       Queue");                      "Job       Queue");
   
         for (i = 0; i < numjobs; i++) {          for (i = 0; i < numjobs; i++) {
                 print_job(atjobs[i], i + 1, shortformat);                  print_job(atjobs[i], i + 1, &stbuf, shortformat);
                 free(atjobs[i]);                  free(atjobs[i]);
         }          }
         free(atjobs);          free(atjobs);
Line 678 
Line 675 
                 job_matches = (argc == 0) ? 1 : 0;                  job_matches = (argc == 0) ? 1 : 0;
                 if (!job_matches) {                  if (!job_matches) {
                         for (i = 0; i < jobs_len; i++) {                          for (i = 0; i < jobs_len; i++) {
                                 if (jobs[i] != NULL &&                                  if (strcmp(dirent->d_name, jobs[i]) == 0) {
                                     strcmp(dirent->d_name, jobs[i]) == 0) {  
                                         jobs[i] = NULL;                                          jobs[i] = NULL;
                                         job_matches = 1;                                          job_matches = 1;
                                         break;                                          break;

Legend:
Removed from v.1.30.2.1  
changed lines
  Added in v.1.31