From bf4394ee95e24266e45ae184ba6f7cd800e5212c Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 18 Sep 2019 10:51:57 -0700 Subject: [PATCH] build differently for openbsd because we can't cross compile the process library --- background_check.go | 14 ++++++++++++++ background_check_openbsd.go | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 background_check.go create mode 100644 background_check_openbsd.go 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") +}