mirror of
https://github.com/tailscale/tailscale.git
synced 2024-12-05 07:55:36 +00:00
portlist: move sync.Once up and Close on err
Signed-off-by: Marwan Sulaiman <marwan@tailscale.com>
This commit is contained in:
parent
27ea062078
commit
821c589f98
@ -296,6 +296,7 @@ func NewLocalBackend(logf logger.Logf, logID logid.PublicID, sys *tsd.System, lo
|
||||
err = portpoll.Check()
|
||||
if err != nil {
|
||||
logf("skipping portlist: %s", err)
|
||||
portpoll.Close()
|
||||
portpoll = nil
|
||||
}
|
||||
|
||||
|
@ -29,9 +29,8 @@ type Poller struct {
|
||||
// This field should only be changed before calling Run.
|
||||
IncludeLocalhost bool
|
||||
|
||||
c chan List // unbuffered
|
||||
|
||||
initOnce sync.Once // guards init of private fields
|
||||
c chan List // unbuffered
|
||||
|
||||
// os, if non-nil, is an OS-specific implementation of the portlist getting
|
||||
// code. When non-nil, it's responsible for getting the complete list of
|
||||
|
Loading…
Reference in New Issue
Block a user