version 1.111, 2019/06/28 05:35:34 |
version 1.112, 2019/06/28 13:35:02 |
|
|
return; |
return; |
} |
} |
pid = fork(); |
pid = fork(); |
if (pid < 0) { |
if (pid == -1) { |
err(1, "fork"); |
err(1, "fork"); |
} else if (pid == 0) { |
} else if (pid == 0) { |
(void)execl(COMPRESS, base, "-f", tmp, (char *)NULL); |
(void)execl(COMPRESS, base, "-f", tmp, (char *)NULL); |
|
|
(void)snprintf(file, sizeof(file), "%s.0", ent->log); |
(void)snprintf(file, sizeof(file), "%s.0", ent->log); |
if (ent->flags & CE_COMPACT) { |
if (ent->flags & CE_COMPACT) { |
if (stat_suffix(file, sizeof(file), COMPRESS_POSTFIX, &sb, |
if (stat_suffix(file, sizeof(file), COMPRESS_POSTFIX, &sb, |
stat) < 0 && stat(file, &sb) < 0) |
stat) < 0 && stat(file, &sb) == -1) |
return (-1); |
return (-1); |
} else { |
} else { |
if (stat(file, &sb) < 0 && stat_suffix(file, sizeof(file), |
if (stat(file, &sb) == -1 && stat_suffix(file, sizeof(file), |
COMPRESS_POSTFIX, &sb, stat) < 0) |
COMPRESS_POSTFIX, &sb, stat) < 0) |
return (-1); |
return (-1); |
} |
} |
|
|
FILE *fp; |
FILE *fp; |
int rd; |
int rd; |
|
|
if (stat(ent->log, &sb) < 0) |
if (stat(ent->log, &sb) == -1) |
return (0); |
return (0); |
|
|
if (noaction) { |
if (noaction) { |
|
|
STATS_DIR, flog); |
STATS_DIR, flog); |
|
|
/* ..if it doesn't exist, simply record the current size. */ |
/* ..if it doesn't exist, simply record the current size. */ |
if ((sb.st_size == 0) || stat(fname, &tsb) < 0) |
if ((sb.st_size == 0) || stat(fname, &tsb) == -1) |
goto update; |
goto update; |
|
|
fp = fopen(fname, "r"); |
fp = fopen(fname, "r"); |