summaryrefslogtreecommitdiff
path: root/src/daemon_linux.go
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2017-11-14 18:26:28 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2017-11-14 18:26:28 +0100
commit88801529fd4097993f7c448b1c3eee0abc8cb51c (patch)
treed1750dc52489b7d5c665918ae522aae5b8fc4f6b /src/daemon_linux.go
parent69fe86edf0ba371b9b0a54e522ec20d33e0ae129 (diff)
downloadwireguard-go-88801529fd4097993f7c448b1c3eee0abc8cb51c.tar.gz
wireguard-go-88801529fd4097993f7c448b1c3eee0abc8cb51c.zip
Moved TUN device creation to pre-fork
Diffstat (limited to 'src/daemon_linux.go')
-rw-r--r--src/daemon_linux.go11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/daemon_linux.go b/src/daemon_linux.go
index 730f89e..8210f8b 100644
--- a/src/daemon_linux.go
+++ b/src/daemon_linux.go
@@ -11,18 +11,9 @@ import (
* TODO: Use env variable to spawn in background
*/
-func Daemonize() error {
+func Daemonize(attr *os.ProcAttr) error {
argv := []string{os.Args[0], "--foreground"}
argv = append(argv, os.Args[1:]...)
- attr := &os.ProcAttr{
- Dir: ".",
- Env: os.Environ(),
- Files: []*os.File{
- os.Stdin,
- nil,
- nil,
- },
- }
process, err := os.StartProcess(
argv[0],
argv,