From 3605887345792d2f981f971c6c4a2cb7f86a343e Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Tue, 11 Sep 2018 22:04:16 +0200 Subject: reorganize package for a more idomatic go --- util/process.go | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 util/process.go (limited to 'util/process.go') diff --git a/util/process.go b/util/process.go deleted file mode 100644 index ddd3f704..00000000 --- a/util/process.go +++ /dev/null @@ -1,23 +0,0 @@ -package util - -import ( - "os" - "syscall" -) - -// ProcessIsRunning tell is a process is running -func ProcessIsRunning(pid int) bool { - // never return no error in a unix system - process, err := os.FindProcess(pid) - - if err != nil { - return false - } - - // Signal 0 doesn't do anything but allow testing the process - err = process.Signal(syscall.Signal(0)) - - // Todo: distinguish "you don't have access" and "process doesn't exist" - - return err == nil -} -- cgit