- winnt_error(status, L"Error reading data from %ls",
- windows_file_to_string(file, buf, sizeof(buf)));
+ winnt_warning(status, L"Error reading data from %ls",
+ windows_file_to_string(file, buf, sizeof(buf)));
+
+ /* Currently these retries are purely a guess;
+ * there is no reproducible problem that they solve. */
+ if (--tries_remaining) {
+ int delay = 100;
+ if (status == STATUS_INSUFFICIENT_RESOURCES ||
+ status == STATUS_NO_MEMORY) {
+ delay *= 25;
+ }
+ WARNING("Retrying after %dms...", delay);
+ Sleep(delay);
+ goto retry_read;
+ }
+ ERROR("Too many retries; returning failure");