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
commit0712ec69c70d5065447f7ffdbd907e3d7ae50ae9 (patch)
treefe870bd30b6990d87e1d1ce01e109f3975f676c3 /service/service_manager.go
parentREADME: backports are missing 1.12 for now (diff)
downloadwireguard-windows-0712ec69c70d5065447f7ffdbd907e3d7ae50ae9.tar.xz
wireguard-windows-0712ec69c70d5065447f7ffdbd907e3d7ae50ae9.zip
ipc: implement event system with pipes
Also use Go 1.12's Sysconn Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
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()
}
}