int killed = 0;
process_handle = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
- if (process_handle == INVALID_HANDLE_VALUE)
+ if (process_handle == NULL)
return 0;
killed += terminate_process(pid, process_handle, sig);
int killed = 0;
process_handle = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
- if (process_handle == INVALID_HANDLE_VALUE)
+ if (process_handle == NULL)
return 0;
killed += terminate_process(pid, process_handle, sig);
return killpg(pid, -sig);
process_handle = OpenProcess(PROCESS_TERMINATE, FALSE, pid);
- if (process_handle != INVALID_HANDLE_VALUE) {
+ /* OpenProcess() returns NULL on error, *not* INVALID_HANDLE_VALUE */
+ if (process_handle != NULL) {
retval = terminate_process(pid, process_handle, sig);
CloseHandle(process_handle);
}