File: pidfile_unix.go

package info (click to toggle)
webhook 2.8.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 11,064 kB
  • sloc: asm: 1,650; sh: 620; xml: 88; makefile: 50; ansic: 24
file content (16 lines) | stat: -rw-r--r-- 238 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// +build !windows,!darwin

package pidfile

import (
	"os"
	"path/filepath"
	"strconv"
)

func processExists(pid int) bool {
	if _, err := os.Stat(filepath.Join("/proc", strconv.Itoa(pid))); err == nil {
		return true
	}
	return false
}