Skip to content

Commit 708275a

Browse files
committed
Remove LAST_ERROR dependency in CreateAndWaitForProcess and use GetLastError() for error codes
- Replace LAST_ERROR return value usage with direct GetLastError() calls. - Resolve compilation failures caused by LAST_ERROR dependency.
1 parent 8595ed9 commit 708275a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/script_info.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,18 @@ BOOL CreateAndWaitForProcess(const char *app_name, char *cmd_line, DWORD *exit_c
218218
if (GetExitCodeProcess(p_info.hProcess, exit_code)) {
219219
result = TRUE;
220220
} else {
221-
*exit_code = LAST_ERROR("Failed to get exit status");
221+
LAST_ERROR("Failed to get exit status");
222+
*exit_code = GetLastError();
222223
}
223224
} else {
224-
*exit_code = LAST_ERROR("Failed to wait script process");
225+
LAST_ERROR("Failed to wait script process");
226+
*exit_code = GetLastError();
225227
}
226228
CloseHandle(p_info.hProcess);
227229
CloseHandle(p_info.hThread);
228230
} else {
229-
*exit_code = LAST_ERROR("Failed to create process");
231+
LAST_ERROR("Failed to create process");
232+
*exit_code = GetLastError();
230233
}
231234

232235
return result;

0 commit comments

Comments
 (0)