version 1.20, 1999/08/27 08:49:29 |
version 1.21, 1999/10/13 17:24:23 |
|
|
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 *)); |
|
|
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"); |
|
|
} |
} |
|
|
/* 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]; |
|
|
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 */ |