err := syscall.Kill(int(dmInfo.Pid), syscall.Signal(0))
        if err == syscall.ESRCH {
          Warning("Daemon stopped for unknown reason. BinaryId:", binaryId)
                  } else {
          if err != nil {
            Info("Daemon got error when signal-ed by 0. err:(", err.Error(),
                ") BinaryId:", binaryId)
          }
                 }

Hi,

I have a code snippet background. It will check if a given process is 
exited. But based on my test, the first line syscall.Kill will always 
return nil even if the child process is already done (e.g. In the test, I 
ran an 'echo' command first and sleep for a long time before calling the 
code snippet above).
I use cmd.Start to start my child process.
Anyone knows why?

Thanks,
Yihao

 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to