mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
portlist: wait for lsof cmd to exit
We were leaking processes otherwise. Co-authored-by: Mihai Parparita <mihai@tailscale.com> Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
parent
a97369f097
commit
b5299d7d0e
@ -159,6 +159,15 @@ func (im *macOSImpl) addProcesses() error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
defer func() {
|
||||||
|
ps, err := lsofCmd.Process.Wait()
|
||||||
|
if err != nil || ps.ExitCode() != 0 {
|
||||||
|
log.Printf("portlist: can't run lsof in Mac sandbox; omitting process names from service list. Error: %v, exit code %d", err, ps.ExitCode())
|
||||||
|
lsofFailed.Store(true)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
defer lsofCmd.Process.Kill()
|
||||||
|
|
||||||
im.br.Reset(outPipe)
|
im.br.Reset(outPipe)
|
||||||
|
|
||||||
var cmd, proto string
|
var cmd, proto string
|
||||||
|
Loading…
Reference in New Issue
Block a user