-void write_status_file(struct fileinfo* fl)
-{
- FILE* dumpfile;
- int localerror = 0;
- dumpfile = fopen(newstatusname, "w");
- if ( !dumpfile )
- {
- char error[80];
- sprintf(error, ", errno=%d\n", errno);
- output("!!! dumpstatus: open failed: ");
- output(newstatusname);
- output(error);
- something_has_changed = 0;
- return;
- }
- while ( fl )
- {
- if ( fprintf(dumpfile, "%s %li %lu\n",
- fl->name, (long) fl->inode,
- (unsigned long) fl->position) < 0 )
- {
- output_error("!!! dumpstatus: write failed");
- localerror = 1;
- break;
- }
- fl = fl->next;
- }
- if ( fclose(dumpfile) && localerror == 0 )
- {
- output_error("!!! dumpstatus: close failed");
- localerror = 1;
- }
- if ( localerror == 0 )
- {
- if ( rename(newstatusname, statusname) )
- {
- output_error("!!! dumpstatus: rename failed");
- }
- }
- something_has_changed = 0;
-}
-
-void read_status()