BSD 4_3_Reno release
[unix-history] / usr / src / usr.bin / at / atq / atq.c
index c14f7ce..b46434b 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)atq.c      5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)atq.c      5.6 (Berkeley) 5/11/89";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -38,10 +38,7 @@ static char sccsid[] = "@(#)atq.c    5.2 (Berkeley) %G%";
 # include <sys/time.h>
 # include <pwd.h>
 # include <ctype.h>
 # include <sys/time.h>
 # include <pwd.h>
 # include <ctype.h>
-# define ATDIR         "/usr/spool/at"                 /* spooling area */
-# define LASTFILE      "/usr/spool/at/lasttimedone"    /* update time record 
-                                                          file */
+# include "pathnames.h"
 
 /*
  * Months of the year
 
 /*
  * Months of the year
@@ -111,13 +108,13 @@ char **argv;
         * files in the queue structure. The queue comes back sorted by
         * execution time or creation time.
         */
         * files in the queue structure. The queue comes back sorted by
         * execution time or creation time.
         */
-       if (chdir(ATDIR) == -1) {
-               perror(ATDIR);
+       if (chdir(_PATH_ATDIR) == -1) {
+               perror(_PATH_ATDIR);
                exit(1);
        }
        if ((numentries = scandir(".",&queue,filewanted, (cflag) ? creation : 
                                alphasort)) < 0) {
                exit(1);
        }
        if ((numentries = scandir(".",&queue,filewanted, (cflag) ? creation : 
                                alphasort)) < 0) {
-               perror(ATDIR);
+               perror(_PATH_ATDIR);
                exit(1);
        }
 
                exit(1);
        }
 
@@ -203,7 +200,6 @@ char **namelist;
                                                   spooling area was updated */
        int powner();                           /* print the name of the owner
                                                   of the job */
                                                   spooling area was updated */
        int powner();                           /* print the name of the owner
                                                   of the job */
-       int getid();                            /* get uid of a person */
        char **ptr;                             /* scratch pointer */
        struct stat stbuf;                      /* buffer for file stats */
 
        char **ptr;                             /* scratch pointer */
        struct stat stbuf;                      /* buffer for file stats */
 
@@ -309,24 +305,6 @@ char *file;
 
 }
        
 
 }
        
-
-/*
- * Get the uid of a person using his/her login name. Return -1 if no
- * such account name exists.
- */
-getid(name)
-char *name;
-{
-
-       struct passwd *pwdinfo;                 /* password info structure */
-
-
-       if ((pwdinfo = getpwnam(name)) == 0)
-               return(-1);
-
-       return(pwdinfo->pw_uid);
-}
-
 /*
  * Print the time the spooling area was updated.
  */
 /*
  * Print the time the spooling area was updated.
  */
@@ -346,11 +324,11 @@ plastrun()
         * last update hour. The update time is measured in seconds since
         * 1/1/70.
         */
         * last update hour. The update time is measured in seconds since
         * 1/1/70.
         */
-       if ((last = fopen(LASTFILE,"r")) == NULL) {
-               perror(LASTFILE);
+       if ((last = fopen(_PATH_LASTFILE,"r")) == NULL) {
+               perror(_PATH_LASTFILE);
                exit(1);
        }
                exit(1);
        }
-       fscanf(last,"%d",(u_long) &lasttime);
+       fscanf(last,"%lu",&lasttime);
        fclose(last);
 
        /*
        fclose(last);
 
        /*
@@ -398,7 +376,7 @@ char *filename;
        int year  =  0;                         /* year file will be executed */
        int get_mth_day();                      /* convert a day of year to a
                                                   month and day of month */
        int year  =  0;                         /* year file will be executed */
        int get_mth_day();                      /* convert a day of year to a
                                                   month and day of month */
-       char date[18];                          /* reformatted execution date */
+       char date[19];                          /* reformatted execution date */
 
        /*
         * Pick off the necessary info from the file name and convert the day
 
        /*
         * Pick off the necessary info from the file name and convert the day