diff --git a/background_check.go b/background_check.go new file mode 100644 index 000000000..c86602e68 --- /dev/null +++ b/background_check.go @@ -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 +} diff --git a/background_check_openbsd.go b/background_check_openbsd.go new file mode 100644 index 000000000..04fde4a5b --- /dev/null +++ b/background_check_openbsd.go @@ -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") +}