[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.7 and 1.8

version 1.7, 1997/03/01 23:40:09 version 1.8, 1997/03/02 19:59:15
Line 139 
Line 139 
         return (getcwd(path, sizeof(path)));          return (getcwd(path, sizeof(path)));
 }  }
   
 /* XXX - this code sucks! */  
 static int  static int
 nextjob()  nextjob()
 {  {
Line 232 
Line 231 
         if ((jobno = nextjob()) == EOF)          if ((jobno = nextjob()) == EOF)
             perr("Cannot generate job number");              perr("Cannot generate job number");
   
         /* XXX - use snprintf */          (void)snprintf(ppos, sizeof(atfile) - (ppos - atfile),
         (void)sprintf(ppos, "%c%5x%8x", queue, jobno, (unsigned) (runtimer/60));              "%c%5x%8x", queue, jobno, (unsigned) (runtimer/60));
   
         for (ap = ppos; *ap != '\0'; ap++)          for (ap = ppos; *ap != '\0'; ap++)
                 if (*ap == ' ')                  if (*ap == ' ')
Line 250 
Line 249 
          * their r bit.  Yes, this is a kluge.           * their r bit.  Yes, this is a kluge.
          */           */
         cmask = umask(S_IRUSR | S_IWUSR | S_IXUSR);          cmask = umask(S_IRUSR | S_IWUSR | S_IXUSR);
         /* XXX - use open(2) not creat() */          if ((fdes = open(atfile, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR)) == -1)
         if ((fdes = creat(atfile, O_WRONLY)) == -1)  
                 perr("Cannot create atjob file");                  perr("Cannot create atjob file");
   
         if ((fd2 = dup(fdes)) < 0)          if ((fd2 = dup(fdes)) < 0)

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8