From e59c122dffb54c793e7e960e0df0eca90f1acc54 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 18 Sep 2019 10:51:46 -0700 Subject: [PATCH] build differently for openbsd because we can't cross compile the process library --- main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index f687390cb..4078d306f 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,6 @@ import ( "github.com/mitchellh/cli" "github.com/mitchellh/panicwrap" "github.com/mitchellh/prefixedio" - "github.com/shirou/gopsutil/process" ) func main() { @@ -194,9 +193,12 @@ func wrappedMain() int { ui = basicUi if !inPlugin { currentPID := os.Getpid() - myProc, _ := process.NewProcess(int32(currentPID)) - bg, _ := myProc.Background() - if bg { + backgrounded, err := checkProcess(currentPID) + if err != nil { + fmt.Fprintf(os.Stderr, "cannot determind if process is in "+ + "background: %s\n", err) + } + if backgrounded { fmt.Fprint(os.Stderr, "Running in background, not using a TTY\n") } else if TTY, err := openTTY(); err != nil { fmt.Fprintf(os.Stderr, "No tty available: %s\n", err)