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:
		
							parent
							
								
									70419d31e9
								
							
						
					
					
						commit
						0a2ac84b72
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -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; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue