=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/newsyslog/newsyslog.c,v retrieving revision 1.20 retrieving revision 1.21 diff -c -r1.20 -r1.21 *** src/usr.bin/newsyslog/newsyslog.c 1999/08/27 08:49:29 1.20 --- src/usr.bin/newsyslog/newsyslog.c 1999/10/13 17:24:23 1.21 *************** *** 1,4 **** ! /* $OpenBSD: newsyslog.c,v 1.20 1999/08/27 08:49:29 fgsch Exp $ */ /* * Copyright (c) 1997, Jason Downs. All rights reserved. --- 1,4 ---- ! /* $OpenBSD: newsyslog.c,v 1.21 1999/10/13 17:24:23 millert Exp $ */ /* * Copyright (c) 1997, Jason Downs. All rights reserved. *************** *** 61,67 **** */ #ifndef lint ! static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.20 1999/08/27 08:49:29 fgsch Exp $"; #endif /* not lint */ #ifndef CONF --- 61,67 ---- */ #ifndef lint ! static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.21 1999/10/13 17:24:23 millert Exp $"; #endif /* not lint */ #ifndef CONF *************** *** 143,149 **** int log_trim __P((char *)); void compress_log __P((char *)); int sizefile __P((char *)); ! int age_old_log __P((char *)); char *sob __P((char *)); char *son __P((char *)); int isnumberstr __P((char *)); --- 143,149 ---- int log_trim __P((char *)); void compress_log __P((char *)); int sizefile __P((char *)); ! int age_old_log __P((char *, int *)); char *sob __P((char *)); char *son __P((char *)); int isnumberstr __P((char *)); *************** *** 197,203 **** printf("%s <%d%s>: ", ent->log, ent->numlogs, (ent->flags & CE_COMPACT) ? "Z" : ""); size = sizefile(ent->log); ! modtime = age_old_log(ent->log); if (size < 0) { if (verbose) printf("does not exist.\n"); --- 197,204 ---- printf("%s <%d%s>: ", ent->log, ent->numlogs, (ent->flags & CE_COMPACT) ? "Z" : ""); size = sizefile(ent->log); ! if (age_old_log(ent->log, &modtime) == -1) ! modtime = 0; if (size < 0) { if (verbose) printf("does not exist.\n"); *************** *** 564,571 **** } /* Return the age of old log file (file.0) */ ! int age_old_log(file) char *file; { struct stat sb; char tmp[MAXPATHLEN]; --- 565,573 ---- } /* Return the age of old log file (file.0) */ ! int age_old_log(file, mtime) char *file; + int *mtime; { struct stat sb; char tmp[MAXPATHLEN]; *************** *** 574,580 **** if (stat(strcat(tmp,".0"),&sb) < 0) if (stat(strcat(tmp,COMPRESS_POSTFIX), &sb) < 0) return(-1); ! return( (int) (timenow - sb.st_mtime + 1800) / 3600); } /* Skip Over Blanks */ --- 576,583 ---- if (stat(strcat(tmp,".0"),&sb) < 0) if (stat(strcat(tmp,COMPRESS_POSTFIX), &sb) < 0) return(-1); ! *mtime = (int) (timenow - sb.st_mtime + 1800) / 3600; ! return(0); } /* Skip Over Blanks */