xlstat_isreg(path_ductdefer, &stab, &noent, "defer file");
if (noent) {
debug("startup: ductdefer ENOENT");
} else {
debug("startup: ductdefer nlink=%ld", (long)stab.st_nlink);
switch (stab.st_nlink==1) {
xlstat_isreg(path_ductdefer, &stab, &noent, "defer file");
if (noent) {
debug("startup: ductdefer ENOENT");
} else {
debug("startup: ductdefer nlink=%ld", (long)stab.st_nlink);
switch (stab.st_nlink==1) {
if (ipf == backlog_input_file) {
notice_processed(ipf,"backlog file",ipf->path);
close_input_file(ipf);
if (ipf == backlog_input_file) {
notice_processed(ipf,"backlog file",ipf->path);
close_input_file(ipf);
- if (unlink(ipf->path))
- sysdie("could not unlink done backlog file %s", ipf->path);
+ if (unlink(ipf->path)) {
+ if (errno != ENOENT)
+ sysdie("could not unlink processed backlog file %s", ipf->path);
+ warn("backlog file %s vanished while we were reading it"
+ " so we couldn't remove it (but it's done now, anyway)",
+ ipf->path);
+ }
- notice("feed dropped and our work is complete"
- " (but check for backlog files)");
+ if (search_backlog_file()) {
+ debug("feed dropped but still backlogs to process");
+ return;
+ }
+ notice("feed dropped and our work is complete");
r= unlink(path_ductlock);
if (r) sysdie("unlink lock file for old feed %s", path_ductlock);
exit(0);
r= unlink(path_ductlock);
if (r) sysdie("unlink lock file for old feed %s", path_ductlock);
exit(0);
glob_t gl;
int r;
struct stat stab;
const char *oldest_path=0;
time_t oldest_mtime, now;
glob_t gl;
int r;
struct stat stab;
const char *oldest_path=0;
time_t oldest_mtime, now;
r= glob(globpat_backlog, GLOB_ERR|GLOB_MARK|GLOB_NOSORT, 0, &gl);
r= glob(globpat_backlog, GLOB_ERR|GLOB_MARK|GLOB_NOSORT, 0, &gl);
age, age_deficiency, oldest_path);
backlog_input_file= open_input_file();
age, age_deficiency, oldest_path);
backlog_input_file= open_input_file();
debug("backlog scan: young age=%f deficiency=%ld nextscan=%d oldest=%s",
age, age_deficiency, backlog_nextscan_periods, oldest_path);
debug("backlog scan: young age=%f deficiency=%ld nextscan=%d oldest=%s",
age, age_deficiency, backlog_nextscan_periods, oldest_path);