mirror of
https://github.com/safing/portmaster
synced 2025-09-04 11:39:29 +00:00
Merge pull request #68 from safing/feature/clean-linux-process-paths
Remove " (deleted)" suffix on linux for deleted files
This commit is contained in:
commit
b8a12f8b9a
1 changed files with 9 additions and 0 deletions
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -15,6 +16,10 @@ import (
|
||||||
"github.com/safing/portmaster/profile"
|
"github.com/safing/portmaster/profile"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
onLinux = runtime.GOOS == "linux"
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
dupReqMap = make(map[int]*sync.WaitGroup)
|
dupReqMap = make(map[int]*sync.WaitGroup)
|
||||||
dupReqLock sync.Mutex
|
dupReqLock sync.Mutex
|
||||||
|
@ -263,6 +268,10 @@ func loadProcess(ctx context.Context, pid int) (*Process, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to get Path for p%d: %s", pid, err)
|
return nil, fmt.Errorf("failed to get Path for p%d: %s", pid, err)
|
||||||
}
|
}
|
||||||
|
// remove linux " (deleted)" suffix for deleted files
|
||||||
|
if onLinux {
|
||||||
|
new.Path = strings.TrimSuffix(new.Path, " (deleted)")
|
||||||
|
}
|
||||||
// Executable Name
|
// Executable Name
|
||||||
_, new.ExecName = filepath.Split(new.Path)
|
_, new.ExecName = filepath.Split(new.Path)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue