1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[core] Only retry writes when they fail

ClearMBRGPT attempts to write WRITE_RETRIES times, even if all those
times succeed.

Instead, skip the remaining retries on success.
This commit is contained in:
Derek Foreman 2020-02-13 16:19:46 -06:00
parent 70419d31e9
commit 0a2ac84b72

View file

@ -726,7 +726,7 @@ static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSi
uprintf("Retrying in %d seconds...", WRITE_TIMEOUT / 1000);
// Don't sit idly but use the downtime to check for conflicting processes...
Sleep(CheckDriveAccess(WRITE_TIMEOUT, FALSE));
}
} else break;
}
}
for (i = last_sector - MAX_SECTORS_TO_CLEAR; i < last_sector; i++) {
@ -743,7 +743,7 @@ static BOOL ClearMBRGPT(HANDLE hPhysicalDrive, LONGLONG DiskSize, DWORD SectorSi
r = TRUE;
goto out;
}
}
} else break;
}
}
r = TRUE;