Commit fee30f11 authored by Mikhail Karpenko's avatar Mikhail Karpenko

Flush state file content before closing file

parent 976af575
......@@ -155,6 +155,8 @@ static int save_state_file(const rawdev_buffer *rawdev)
}
fprintf(f, "Device\t\tStart LBA\tCurrent LBA\tEnd LBA\n");
fprintf(f, STATE_FILE_FORMAT, rawdev->rawdev_path, range.from, curr_pos, range.to);
fflush(f);
fsync(fileno(f));
fclose(f);
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment