From 22549b0388c685c01aa59e10d6318ba69006e263 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 4 May 2013 13:29:45 -0700 Subject: [PATCH] Fix race condition issue where listner could become nil --- packer/rpc/server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packer/rpc/server.go b/packer/rpc/server.go index b3783de85..4ed4cb25e 100644 --- a/packer/rpc/server.go +++ b/packer/rpc/server.go @@ -46,16 +46,16 @@ func (s *Server) Start() error { } // Start accepting connections - go func() { + go func(l net.Listener) { for { - conn, err := s.listener.Accept() + conn, err := l.Accept() if err != nil { break } go s.server.ServeConn(conn) } - }() + }(s.listener) return nil }