=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/at/at.c,v retrieving revision 1.30.2.1 retrieving revision 1.31 diff -u -r1.30.2.1 -r1.31 --- src/usr.bin/at/at.c 2003/03/18 04:06:47 1.30.2.1 +++ src/usr.bin/at/at.c 2002/11/20 19:57:19 1.31 @@ -1,4 +1,4 @@ -/* $OpenBSD: at.c,v 1.30.2.1 2003/03/18 04:06:47 margarida Exp $ */ +/* $OpenBSD: at.c,v 1.31 2002/11/20 19:57:19 millert Exp $ */ /* $NetBSD: at.c,v 1.4 1995/03/25 18:13:31 glass Exp $ */ /* @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -74,7 +73,7 @@ #define TIMESIZE 50 /* Size of buffer passed to strftime() */ #ifndef lint -static const char rcsid[] = "$OpenBSD: at.c,v 1.30.2.1 2003/03/18 04:06:47 margarida Exp $"; +static const char rcsid[] = "$OpenBSD: at.c,v 1.31 2002/11/20 19:57:19 millert Exp $"; #endif /* Variables to remove from the job's environment. */ @@ -409,7 +408,7 @@ } 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 tm runtime; @@ -424,7 +423,7 @@ (void)printf("%ld.%c\t%s\n", (long)job->runtimer, job->queue, timestr); } else { - pw = getpwuid(job->uid); + pw = getpwuid(st->st_uid); /* Rank hack shamelessly stolen from lpq */ if (n / 10 == 1) printf("%3d%-5s", n,"th"); @@ -434,7 +433,7 @@ (void)printf("%-21.18s%-11.8s%10ld.%c %c%s\n", timestr, pw ? pw->pw_name : "???", (long)job->runtimer, job->queue, job->queue, - (S_IXUSR & job->mode) ? "" : " (done)"); + (S_IXUSR & st->st_mode) ? "" : " (done)"); } } @@ -549,8 +548,6 @@ err(EXIT_FAILURE, "malloc"); job->runtimer = runtimer; job->ctime = stbuf.st_ctime; - job->uid = stbuf.st_uid; - job->mode = stbuf.st_mode; job->queue = queue; if (numjobs == maxjobs) { maxjobs *= 2; @@ -580,7 +577,7 @@ "Job Queue"); 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); @@ -678,8 +675,7 @@ job_matches = (argc == 0) ? 1 : 0; if (!job_matches) { for (i = 0; i < jobs_len; i++) { - if (jobs[i] != NULL && - strcmp(dirent->d_name, jobs[i]) == 0) { + if (strcmp(dirent->d_name, jobs[i]) == 0) { jobs[i] = NULL; job_matches = 1; break;