diff --git a/libs/freetdm/src/zap_wanpipe.c b/libs/freetdm/src/zap_wanpipe.c index 57c1aa7400..70f9ffefa5 100644 --- a/libs/freetdm/src/zap_wanpipe.c +++ b/libs/freetdm/src/zap_wanpipe.c @@ -323,13 +323,13 @@ static ZINT_WAIT_FUNCTION(wanpipe_wait_windows) api_poll.user_flags_bitmap = inflags; api_poll.timeout = to; + *flags = ZAP_NO_FLAGS; + if(DoApiPollCommand(zchan->sockfd, &api_poll)){ snprintf(zchan->last_error, sizeof(zchan->last_error), "Poll failed"); return ZAP_FAIL; } - *flags = ZAP_NO_FLAGS; - switch(api_poll.operation_status) { case SANG_STATUS_RX_DATA_AVAILABLE: