Fix pidToPath on FreeBSD

This commit is contained in:
2025-04-04 21:59:46 -04:00
parent 4fa746ddce
commit 5369c3aa44
3 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ func handleConn(conn net.Conn) {
// pidToPath returns the path of the executable that has the given PID.
func pidToPath(pid int) string {
path, _ := os.Readlink(fmt.Sprintf("/proc/%d/exe", pid))
path, _ := os.Readlink(fmt.Sprintf("/proc/%d/"+pidPathFile, pid))
return path
}
+5
View File
@@ -0,0 +1,5 @@
//go:build freebsd
package daemon
const pidPathFile = "file"
+5
View File
@@ -0,0 +1,5 @@
//go:build linux
package daemon
const pidPathFile = "exe"