mirror of https://github.com/hashicorp/consul
agent/proxy: address PR feedback
parent
f5e7993249
commit
b4ba31c61b
|
@ -284,6 +284,7 @@ func (p *Daemon) Stop() error {
|
|||
// used only for tests.
|
||||
func (p *Daemon) stopKeepAlive() error {
|
||||
p.lock.Lock()
|
||||
defer p.lock.Unlock()
|
||||
|
||||
// If we're already stopped or never started, then no problem.
|
||||
if p.stopped || p.process == nil {
|
||||
|
@ -295,7 +296,6 @@ func (p *Daemon) stopKeepAlive() error {
|
|||
// Note that we've stopped
|
||||
p.stopped = true
|
||||
close(p.stopCh)
|
||||
p.lock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -22,9 +22,9 @@ func findProcess(pid int) (*os.Process, error) {
|
|||
// a 0 signal. This will do nothing to the process but will still
|
||||
// return errors if the process is gone.
|
||||
err = p.Signal(syscall.Signal(0))
|
||||
if err == nil || err == syscall.EPERM {
|
||||
if err == nil {
|
||||
return p, nil
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("process is dead")
|
||||
return nil, fmt.Errorf("process %d is dead or running as another user", pid)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue