Skip to content

Commit d0f74c9

Browse files
authored
Merge pull request #15 from adam-p/check-failbit
check the failbit after closing the datastore file
2 parents 64bf896 + e2562ee commit d0f74c9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

datastore.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ static Error FileStore(int transaction_depth, const string& file_path, const jso
230230

231231
f.close();
232232

233+
if (f.fail()) {
234+
return MakeCriticalError(utils::Stringer("temp_file_path close failed; errno=", errno));
235+
}
236+
233237
/*
234238
Rename temp to commit
235239
*/

0 commit comments

Comments
 (0)