-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
providers/darwin/process: fix error handling (#150)
* providers/darwin/process: fix error handling kern_procargs was not returning an error when kern.procargs2 failed. Then meant that you didn't get an error when the process no longer exists or when you didn't have permissions to access the process. For process.Info(), this especially affected builds running without CGO enabled. When running with CGO there are other calls that will fail with "no such process" or "operation not permitted" before we get to calling kern.procargs2, but without CGO it goes directly to calling kern.procargs2. This resulted in Info() returning a zero value types.ProcessInfo and no error. Fixes #148 * system_test.go: Ignore EINVAL for process.Info() Non-CGO build will return EINVAL when a process does not exist.
- Loading branch information
1 parent
2841c12
commit dbd6a9d
Showing
4 changed files
with
56 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters