-static void statmc_finishdone(void) {
- time_t now;
- struct stat stab;
-
- assert(sms == sm_FINISHING);
-
- r= fstat(fileno(defer), &stab);
- if (r) sysdie("check defer file %s", path_defer);
-
- if (fclose(defer)) sysdie("could not close defer file %s", path_defer);
- defer= 0;
-
- now= time(0);
- if (now==-1) sysdie("could not get current time for backlog filename");
-
- char *backlog= xasprintf("%s_backlog_%lu.%lu", feedfile,
- (unsigned long)now,
- (unsigned long)stab.st_ino);
- if (link(path_defer, path_backlog))
- sysdie("could not install defer file %s as backlog file %s",
- path_defer, backlog);
- if (unlink(path_defer))
- sysdie("could not unlink old defer link %s to backlog file %s",
- path_defer, backlog);
- open_defer();
-
- close_input_file(old_input_file);
- old_input_file= 0;
-
- if (unlink(path_duct))
- sysdie("could not unlink old duct file %s", path_duct);
-
- sms= sm_NORMAL;
-}
-