mirror of
https://github.com/rwinkhart/rcw.git
synced 2026-08-27 20:36:30 -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.
|
// pidToPath returns the path of the executable that has the given PID.
|
||||||
func pidToPath(pid int) string {
|
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
|
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