fold fork() into getReturnCode()