github.com/Aestek/consul@v1.2.4-0.20190309222502-b2c31e33971a/agent/proxyprocess/exitstatus_syscall.go (about)

     1  // +build darwin linux windows
     2  
     3  package proxyprocess
     4  
     5  import (
     6  	"os"
     7  	"syscall"
     8  )
     9  
    10  // exitStatus for platforms with syscall.WaitStatus which are listed
    11  // at the top of this file in the build constraints.
    12  func exitStatus(ps *os.ProcessState) (int, bool) {
    13  	if status, ok := ps.Sys().(syscall.WaitStatus); ok {
    14  		return status.ExitStatus(), true
    15  	}
    16  
    17  	return 0, false
    18  }