From e690bd4e21c46428342d9fa43b8b15dfb7bef291 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 18 Dec 2017 23:17:09 -0500 Subject: nslcd_systemd: make the connection a param in the handler closure This isn't the source of a problem, since conn is declared inside the loop, so instances of it aren't shared. But, make that clearer. --- nslcd_systemd/nslcd_systemd.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nslcd_systemd/nslcd_systemd.go b/nslcd_systemd/nslcd_systemd.go index 91177a7..c0024e2 100644 --- a/nslcd_systemd/nslcd_systemd.go +++ b/nslcd_systemd/nslcd_systemd.go @@ -189,11 +189,11 @@ func Main(backend Backend, limits nslcd_server.Limits, ctx context.Context) uint if conn != nil { wg.Add(1) id++ - go func(id int) { + go func(conn *net.UnixConn, id int) { defer sd_daemon.Recover() defer wg.Done() - handler(backend, limits, conn.(*net.UnixConn), id, ctx) - }(id) + handler(backend, limits, conn, id, ctx) + }(conn.(*net.UnixConn), id) } } }() -- cgit v1.2.3-54-g00ecf