build differently for openbsd because we can't cross compile the process library

This commit is contained in:
Megan Marsh 2019-09-18 10:51:57 -07:00
parent e59c122dff
commit bf4394ee95
2 changed files with 24 additions and 0 deletions

14
background_check.go Normal file
View File

@ -0,0 +1,14 @@
// +build !openbsd
package main
import (
"github.com/shirou/gopsutil/process"
)
func checkProcess(currentPID int) (bool, error) {
myProc, _ := process.NewProcess(int32(currentPID))
bg, _ := myProc.Background()
return bg, nil
}

View File

@ -0,0 +1,10 @@
package main
import (
"fmt"
)
func openTTY() (packer.TTY, error) {
return false, fmt.Errorf("cannot determine if process is backgrounded in " +
"openbsd")
}