read exit code from process