Use clear_error() instead of clearing the error manually
[fio.git] / filesetup.c
index bf28b41ad161c489390382219602e026b8c6b9b2..40a16638f9ea798a9e4b5c0c97c37ee5e691da15 100644 (file)
@@ -276,10 +276,9 @@ static void get_file_sizes(struct thread_data *td)
        unsigned int i;
 
        for_each_file(td, f, i) {
        unsigned int i;
 
        for_each_file(td, f, i) {
-               if (td->io_ops->open_file(td, f)) {
-                       td->error = 0;
-                       memset(td->verror, 0, sizeof(td->verror));
-               } else
+               if (td->io_ops->open_file(td, f))
+                       clear_error(td);
+               else
                        td->io_ops->close_file(td, f);
        }
 }
                        td->io_ops->close_file(td, f);
        }
 }