log the error code if a child process returns nonzero.