fix: build error

This commit is contained in:
wwqgtxx 2022-11-12 20:59:29 +08:00
parent dc3e144b6a
commit 7300c917dc
2 changed files with 4 additions and 4 deletions

View file

@ -51,17 +51,17 @@ func findProcessName(network string, ip netip.Addr, srcPort int) (*uint32, strin
value, err := syscall.Sysctl(spath)
if err != nil {
return -1, "", err
return nil, "", err
}
buf := []byte(value)
pid, err := defaultSearcher.Search(buf, ip, uint16(srcPort), isTCP)
if err != nil {
return -1, "", err
return nil, "", err
}
pp, err := getExecPathFromPID(pid)
return -1, pp, err
return nil, pp, err
}
func getExecPathFromPID(pid uint32) (string, error) {

View file

@ -5,7 +5,7 @@ package process
import "net/netip"
func findProcessName(network string, ip netip.Addr, srcPort int) (*uint32, string, error) {
return -1, "", ErrPlatformNotSupport
return nil, "", ErrPlatformNotSupport
}
func resolveSocketByNetlink(network string, ip netip.Addr, srcPort int) (uint32, uint32, error) {