- process_handle.go: new file adding processHandle(pid) wrapping os.FindProcess and currentPID() wrapping os.Getpid — referenced by pidfile.go but never defined, breaking the build on dev - pkg/api/provider.go: drop daemonEventPayload entries for entry.Config and entry.StartedAt — fields don't exist on DaemonEntry (which has Started time.Time) Unblocks go-process dev build + tests (10s root, 0.9s exec, 7s api). Co-Authored-By: Virgil <virgil@lethean.io>
17 lines
328 B
Go
17 lines
328 B
Go
package process
|
|
|
|
import "os"
|
|
|
|
// processHandle returns an os.Process for the given PID.
|
|
//
|
|
// proc, err := processHandle(12345)
|
|
func processHandle(pid int) (*os.Process, error) {
|
|
return os.FindProcess(pid)
|
|
}
|
|
|
|
// currentPID returns the calling process ID.
|
|
//
|
|
// pid := currentPID()
|
|
func currentPID() int {
|
|
return os.Getpid()
|
|
}
|