process-exit-status

process-exit-status is a built-in function in `C source code'.

(process-exit-status PROCESS)

Return the exit status of PROCESS or the signal number that killed it.
If PROCESS has not yet exited or died, return 0.