From 8bfa6becc7401b16d7056a8367341264ca7e802a Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 12 Jul 2018 08:48:34 +0100 Subject: win32: better error message in kill(2) When the process architecture of busybox-w32 didn't match that of the target process the error reported was 'Function not implemented'. Change this to 'Permission denied'. --- win32/process.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'win32') diff --git a/win32/process.c b/win32/process.c index 9acc66f81..74f949d07 100644 --- a/win32/process.c +++ b/win32/process.c @@ -627,6 +627,7 @@ static int kill_pids(pid_t pid, int exit_code, kill_callback killer) } for (i = len - 1; i >= 0; i--) { + SetLastError(0); if (killer(pids[i], exit_code)) { errno = err_win_to_posix(GetLastError()); ret = -1; @@ -693,6 +694,7 @@ int kill_SIGTERM_by_handle(HANDLE process, int exit_code) } if (!exit_process_address || !process_architecture_matches_current(process)) { + SetLastError(ERROR_ACCESS_DENIED); ret = -1; goto finish; } -- cgit v1.2.3-55-g6feb