diff options
Diffstat (limited to 'otafault/ota_io.cpp')
-rw-r--r-- | otafault/ota_io.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/otafault/ota_io.cpp b/otafault/ota_io.cpp index 04458537b..dd805e56e 100644 --- a/otafault/ota_io.cpp +++ b/otafault/ota_io.cpp @@ -29,6 +29,7 @@ static std::map<intptr_t, const char*> filename_cache; static std::string read_fault_file_name = ""; static std::string write_fault_file_name = ""; static std::string fsync_fault_file_name = ""; +bool have_eio_error = false; static bool get_hit_file(const char* cached_path, std::string ffn) { return should_hit_cache() @@ -48,8 +49,6 @@ void ota_set_fault_files() { } } -bool have_eio_error = false; - int ota_open(const char* path, int oflags) { // Let the caller handle errors; we do not care if open succeeds or fails int fd = open(path, oflags); @@ -92,6 +91,7 @@ size_t ota_fread(void* ptr, size_t size, size_t nitems, FILE* stream) { } } size_t status = fread(ptr, size, nitems, stream); + // If I/O error occurs, set the retry-update flag. if (status != nitems && errno == EIO) { have_eio_error = true; } |