Skip to content

Commit

Permalink
fix undefined processExists error (megaease#87)
Browse files Browse the repository at this point in the history
* fix error
daemon/daemon.go:90:5: undefined: processExists
just a copy of daemon_darwin

* remove openbsd and rename daemon_unix
also update the build contraints

* update the build contraints

* this got added by vscode

* added the rest of the systems that should work with this
file without a problem

* Exclude linux & windows instead
now we support more platforms out of the box
  • Loading branch information
proditis committed May 16, 2022
1 parent 4dd230d commit a0673b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions daemon/daemon_linux.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build !windows && !darwin
// +build !windows,!darwin
//go:build linux
// +build linux

/*
* Copyright (c) 2022, MegaEase
Expand Down
6 changes: 3 additions & 3 deletions daemon/daemon_darwin.go → daemon/daemon_unix.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:build darwin
// +build darwin
//go:build !linux && !windows
// +build !linux,!windows

/*
* Copyright (c) 2022, MegaEase
Expand All @@ -23,7 +23,7 @@ package daemon
import "golang.org/x/sys/unix"

func processExists(pid int) bool {
// OS X does not have a proc filesystem.
// OS X & BSD systems don't have a proc filesystem.
// Use kill -0 pid to judge if the process exists.
err := unix.Kill(pid, 0)
return err == nil
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ require (
go.mongodb.org/mongo-driver v1.9.0
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
golang.org/x/exp v0.0.0-20220328175248-053ad81199eb
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)
Expand Down Expand Up @@ -47,7 +48,6 @@ require (
github.com/xdg-go/stringprep v1.0.2 // indirect
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
Expand Down

0 comments on commit a0673b7

Please sign in to comment.