Finish poll() code.