1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-05-01 13:48:52 +08:00

Merge pull request #1142 from maier/master

fixes for mem_solaris.go
This commit is contained in:
shirou 2021-10-09 22:48:31 +09:00 committed by GitHub
commit 285b4a4a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,9 +143,9 @@ func SwapDevices() ([]*SwapDevice, error) {
func SwapDevicesWithContext(ctx context.Context) ([]*SwapDevice, error) { func SwapDevicesWithContext(ctx context.Context) ([]*SwapDevice, error) {
swapsCommandPath, err := exec.LookPath(swapsCommand) swapsCommandPath, err := exec.LookPath(swapsCommand)
if err != nil { if err != nil {
return nil, fmt.Errorf("could not find command %q: %w", swapCommand, err) return nil, fmt.Errorf("could not find command %q: %w", swapsCommand, err)
} }
output, err := invoke.CommandWithContext(swapsCommandPath, "-l") output, err := invoke.CommandWithContext(ctx, swapsCommandPath, "-l")
if err != nil { if err != nil {
return nil, fmt.Errorf("could not execute %q: %w", swapsCommand, err) return nil, fmt.Errorf("could not execute %q: %w", swapsCommand, err)
} }