From e2562ee219ae27a069af80f6e41f4f740ddab277 Mon Sep 17 00:00:00 2001 From: Adam Pritchard Date: Tue, 9 Nov 2021 16:44:56 -0500 Subject: [PATCH] check the failbit after closing the datastore file This is per the documentation that indicates that the failbit is set if close fails. --- datastore.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/datastore.cpp b/datastore.cpp index 8869289..d91ff34 100644 --- a/datastore.cpp +++ b/datastore.cpp @@ -230,6 +230,10 @@ static Error FileStore(int transaction_depth, const string& file_path, const jso f.close(); + if (f.fail()) { + return MakeCriticalError(utils::Stringer("temp_file_path close failed; errno=", errno)); + } + /* Rename temp to commit */