aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/service/service_manager.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-02-28 03:58:43 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-28 08:05:02 +0100
commit2c40b69ae2bda312e2c2afb596a30c440405c90a (patch)
treefe870bd30b6990d87e1d1ce01e109f3975f676c3 /service/service_manager.go
parentREADME: backports are missing 1.12 for now (diff)
downloadwireguard-windows-2c40b69ae2bda312e2c2afb596a30c440405c90a.tar.xz
wireguard-windows-2c40b69ae2bda312e2c2afb596a30c440405c90a.zip
ipc: implement event system with pipes
Also use Go 1.12's Sysconn
Diffstat (limited to 'service/service_manager.go')
-rw-r--r--service/service_manager.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/service/service_manager.go b/service/service_manager.go
index 9f529bd1..eb28e833 100644
--- a/service/service_manager.go
+++ b/service/service_manager.go
@@ -180,7 +180,8 @@ func (service *managerService) Execute(args []string, r <-chan svc.ChangeRequest
elog.Error(1, "Unable to create two inheritable pipes: "+err.Error())
return
}
- err = IPCServerListen(ourReader, ourWriter)
+ ourEvents, theirEvents, theirEventStr, err := inheritableEvents()
+ err = IPCServerListen(ourReader, ourWriter, ourEvents)
if err != nil {
elog.Error(1, "Unable to listen on IPC pipes: "+err.Error())
return
@@ -193,9 +194,10 @@ func (service *managerService) Execute(args []string, r <-chan svc.ChangeRequest
},
Files: []*os.File{devNull, devNull, devNull},
}
- proc, err := os.StartProcess(path, []string{path, "/ui", theirReaderStr, theirWriterStr}, attr)
+ proc, err := os.StartProcess(path, []string{path, "/ui", theirReaderStr, theirWriterStr, theirEventStr}, attr)
theirReader.Close()
theirWriter.Close()
+ theirEvents.Close()
if err != nil {
elog.Error(1, "Unable to start manager UI process: "+err.Error())
return
@@ -210,6 +212,7 @@ func (service *managerService) Execute(args []string, r <-chan svc.ChangeRequest
procsLock.Unlock()
ourReader.Close()
ourWriter.Close()
+ ourEvents.Close()
}
}