[misc] improve readability of error code handling

* Also don't pass a read size value in WriteFileWithRetry() if we don't use it.
This commit is contained in:
Pete Batard 2024-04-01 02:16:41 +01:00
parent 52ca79816f
commit 8a5a5a318a
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
25 changed files with 257 additions and 252 deletions

View file

@ -830,7 +830,7 @@ DWORD RunCommandWithProgress(const char* cmd, const char* dir, BOOL log, int msg
UpdateProgressWithInfoInit(NULL, FALSE);
while (1) {
// Check for user cancel
if (IS_ERROR(FormatStatus) && (SCODE_CODE(FormatStatus) == ERROR_CANCELLED)) {
if (IS_ERROR(ErrorStatus) && (SCODE_CODE(ErrorStatus) == ERROR_CANCELLED)) {
if (!TerminateProcess(pi.hProcess, ERROR_CANCELLED)) {
uprintf("Could not terminate command: %s", WindowsErrorString());
} else switch (WaitForSingleObject(pi.hProcess, 5000)) {