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

Diff for /src/usr.bin/newsyslog/newsyslog.c between version 1.20 and 1.21

version 1.20, 1999/08/27 08:49:29 version 1.21, 1999/10/13 17:24:23
Line 143 
Line 143 
 int log_trim __P((char *));  int log_trim __P((char *));
 void compress_log __P((char *));  void compress_log __P((char *));
 int sizefile __P((char *));  int sizefile __P((char *));
 int age_old_log __P((char *));  int age_old_log __P((char *, int *));
 char *sob __P((char *));  char *sob __P((char *));
 char *son __P((char *));  char *son __P((char *));
 int isnumberstr __P((char *));  int isnumberstr __P((char *));
Line 197 
Line 197 
                 printf("%s <%d%s>: ", ent->log, ent->numlogs,                  printf("%s <%d%s>: ", ent->log, ent->numlogs,
                         (ent->flags & CE_COMPACT) ? "Z" : "");                          (ent->flags & CE_COMPACT) ? "Z" : "");
         size = sizefile(ent->log);          size = sizefile(ent->log);
         modtime = age_old_log(ent->log);          if (age_old_log(ent->log, &modtime) == -1)
                   modtime = 0;
         if (size < 0) {          if (size < 0) {
                 if (verbose)                  if (verbose)
                         printf("does not exist.\n");                          printf("does not exist.\n");
Line 564 
Line 565 
 }  }
   
 /* Return the age of old log file (file.0) */  /* Return the age of old log file (file.0) */
 int age_old_log(file)  int age_old_log(file, mtime)
         char    *file;          char    *file;
           int     *mtime;
 {  {
         struct stat sb;          struct stat sb;
         char tmp[MAXPATHLEN];          char tmp[MAXPATHLEN];
Line 574 
Line 576 
         if (stat(strcat(tmp,".0"),&sb) < 0)          if (stat(strcat(tmp,".0"),&sb) < 0)
             if (stat(strcat(tmp,COMPRESS_POSTFIX), &sb) < 0)              if (stat(strcat(tmp,COMPRESS_POSTFIX), &sb) < 0)
                 return(-1);                  return(-1);
         return( (int) (timenow - sb.st_mtime + 1800) / 3600);          *mtime = (int) (timenow - sb.st_mtime + 1800) / 3600;
           return(0);
 }  }
   
 /* Skip Over Blanks */  /* Skip Over Blanks */

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21