diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-12-18 23:17:09 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-12-18 23:17:09 -0500 |
commit | e690bd4e21c46428342d9fa43b8b15dfb7bef291 (patch) | |
tree | 1bafe5155c963e79ed871ed2ef32951431f9b097 /nslcd_systemd | |
parent | 02a94b4d90531bca217d6913bd3f1325f3742ff6 (diff) |
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.
Diffstat (limited to 'nslcd_systemd')
-rw-r--r-- | nslcd_systemd/nslcd_systemd.go | 6 |
1 files 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) } } }() |