diff --git a/dnscrypt-proxy/daemonize.go b/dnscrypt-proxy/daemonize.go new file mode 100644 index 00000000..b4b0a914 --- /dev/null +++ b/dnscrypt-proxy/daemonize.go @@ -0,0 +1,9 @@ +// +build linux + +package main + +import "github.com/VividCortex/godaemon" + +func Daemonize() { + godaemon.MakeDaemon(&godaemon.DaemonAttr{}) +} diff --git a/dnscrypt-proxy/daemonize_placeholder.go b/dnscrypt-proxy/daemonize_placeholder.go new file mode 100644 index 00000000..0139621f --- /dev/null +++ b/dnscrypt-proxy/daemonize_placeholder.go @@ -0,0 +1,6 @@ +// +build !linux + +package main + +func Daemonize() { +} diff --git a/dnscrypt-proxy/main.go b/dnscrypt-proxy/main.go index 1b0e05db..3eae555b 100644 --- a/dnscrypt-proxy/main.go +++ b/dnscrypt-proxy/main.go @@ -7,8 +7,6 @@ import ( "net" "time" - "github.com/VividCortex/godaemon" - "golang.org/x/crypto/curve25519" ) @@ -38,7 +36,7 @@ func main() { panic(err) } if proxy.daemonize { - godaemon.MakeDaemon(&godaemon.DaemonAttr{}) + Daemonize() } proxy.StartProxy() }