diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-28 03:58:43 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-28 08:05:02 +0100 |
commit | 2c40b69ae2bda312e2c2afb596a30c440405c90a (patch) | |
tree | fe870bd30b6990d87e1d1ce01e109f3975f676c3 /service/service_manager.go | |
parent | README: backports are missing 1.12 for now (diff) | |
download | wireguard-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.go | 7 |
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() } } |