mirror of
https://github.com/rwinkhart/rcw.git
synced 2026-08-28 04:46:42 -04:00
Fix pidToPath on FreeBSD
This commit is contained in:
+1
-1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
//go:build freebsd
|
||||
|
||||
package daemon
|
||||
|
||||
const pidPathFile = "file"
|
||||
@@ -0,0 +1,5 @@
|
||||
//go:build linux
|
||||
|
||||
package daemon
|
||||
|
||||
const pidPathFile = "exe"
|
||||
Reference in New Issue
Block a user