aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/uapi_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/uapi_linux.go')
-rw-r--r--ipc/uapi_linux.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipc/uapi_linux.go b/ipc/uapi_linux.go
index bda19e9..fddded0 100644
--- a/ipc/uapi_linux.go
+++ b/ipc/uapi_linux.go
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: MIT
*
- * Copyright (C) 2017-2020 WireGuard LLC. All Rights Reserved.
+ * Copyright (C) 2017-2025 WireGuard LLC. All Rights Reserved.
*/
package ipc
@@ -51,7 +51,6 @@ func (l *UAPIListener) Addr() net.Addr {
}
func UAPIListen(name string, file *os.File) (net.Listener, error) {
-
// wrap file in listener
listener, err := net.FileListener(file)
@@ -97,14 +96,15 @@ func UAPIListen(name string, file *os.File) (net.Listener, error) {
}
go func(l *UAPIListener) {
- var buff [0]byte
+ var buf [0]byte
for {
+ defer uapi.inotifyRWCancel.Close()
// start with lstat to avoid race condition
if _, err := os.Lstat(socketPath); os.IsNotExist(err) {
l.connErr <- err
return
}
- _, err := uapi.inotifyRWCancel.Read(buff[:])
+ _, err := uapi.inotifyRWCancel.Read(buf[:])
if err != nil {
l.connErr <- err
return