diff options
| author | Ron Yorston <rmy@pobox.com> | 2018-07-12 08:48:34 +0100 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2018-07-12 08:48:34 +0100 |
| commit | 8bfa6becc7401b16d7056a8367341264ca7e802a (patch) | |
| tree | b90ba2f9e04d3901f27aa6643c00e3a747a2bed7 | |
| parent | 83f299376147a26436bc668ebcf0966a05010951 (diff) | |
| download | busybox-w32-8bfa6becc7401b16d7056a8367341264ca7e802a.tar.gz busybox-w32-8bfa6becc7401b16d7056a8367341264ca7e802a.tar.bz2 busybox-w32-8bfa6becc7401b16d7056a8367341264ca7e802a.zip | |
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'.
| -rw-r--r-- | win32/process.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) | |||
| 627 | } | 627 | } |
| 628 | 628 | ||
| 629 | for (i = len - 1; i >= 0; i--) { | 629 | for (i = len - 1; i >= 0; i--) { |
| 630 | SetLastError(0); | ||
| 630 | if (killer(pids[i], exit_code)) { | 631 | if (killer(pids[i], exit_code)) { |
| 631 | errno = err_win_to_posix(GetLastError()); | 632 | errno = err_win_to_posix(GetLastError()); |
| 632 | ret = -1; | 633 | ret = -1; |
| @@ -693,6 +694,7 @@ int kill_SIGTERM_by_handle(HANDLE process, int exit_code) | |||
| 693 | } | 694 | } |
| 694 | if (!exit_process_address || | 695 | if (!exit_process_address || |
| 695 | !process_architecture_matches_current(process)) { | 696 | !process_architecture_matches_current(process)) { |
| 697 | SetLastError(ERROR_ACCESS_DENIED); | ||
| 696 | ret = -1; | 698 | ret = -1; |
| 697 | goto finish; | 699 | goto finish; |
| 698 | } | 700 | } |
