[v3] fix Signal import on dragonfly OS in fallback

This commit is contained in:
shirou 2021-10-17 12:59:41 +00:00
parent ed7efd5d01
commit 4db4dc09a0
3 changed files with 8 additions and 3 deletions

View File

@ -16,6 +16,8 @@ jobs:
go-version: ${{ matrix.go-version }} go-version: ${{ matrix.go-version }}
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/src/github.com/shirou/gopsutil
- name: Get dependencies - name: Get dependencies
if: runner.os != 'Windows' if: runner.os != 'Windows'
run: | run: |
@ -24,13 +26,13 @@ jobs:
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
echo "PATH=$GOPATH/bin:$PATH" >> $GITHUB_PATH echo "PATH=$GOPATH/bin:$PATH" >> $GITHUB_PATH
fi fi
cd /home/runner/work/gopsutil/gopsutil/ cd $GOPATH/src/github.com/shirou/gopsutil
dep ensure dep ensure
# exclude v3 from being run with ./... # exclude v3 from being run with ./...
rm -rf $GOPATH/src/github.com/shirou/gopsutil/v3 rm -rf $GOPATH/src/github.com/shirou/gopsutil/v3
- name: Build Test v2 - name: Build Test v2
run: | run: |
make build_test cd $GOPATH/src/github.com/shirou/gopsutil && make build_test
build_test_v3: build_test_v3:
strategy: strategy:
matrix: matrix:

View File

@ -4,12 +4,15 @@ package process
import ( import (
"context" "context"
"syscall"
"github.com/shirou/gopsutil/v3/cpu" "github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v3/internal/common" "github.com/shirou/gopsutil/v3/internal/common"
"github.com/shirou/gopsutil/v3/net" "github.com/shirou/gopsutil/v3/net"
) )
type Signal = syscall.Signal
type MemoryMapsStat struct { type MemoryMapsStat struct {
Path string `json:"path"` Path string `json:"path"`
Rss uint64 `json:"rss"` Rss uint64 `json:"rss"`

View File

@ -82,7 +82,7 @@ func isMount(path string) bool {
if err != nil { if err != nil {
return false return false
} }
if fileInfo.Mode() & os.ModeSymlink != 0 { if fileInfo.Mode()&os.ModeSymlink != 0 {
return false return false
} }
var stat1 unix.Stat_t var stat1 unix.Stat_t