#endif
}
+void tdmv_api_close_socket(sng_fd_t *sp)
+{
+ if( *sp != INVALID_HANDLE_VALUE){
+#if defined(__WINDOWS__)
+ CloseHandle(*sp);
+#else
+ close(*sp);
+#endif
+ *sp = INVALID_HANDLE_VALUE;
+ }
+}
+
#ifdef __WINDOWS__
static int wanpipe_api_ioctl(sng_fd_t fd, wan_cmd_api_t *api_cmd)
{
return ZAP_SUCCESS;
}
-#if defined(__WINDOWS__)
-#define close(handle) CloseHandle(handle)
-#endif
-
-#define zap_wanpipe_socket_close(it) if (it != WP_INVALID_SOCKET) { close(it); it = WP_INVALID_SOCKET;}
-
zap_status_t wanpipe_destroy(void)
{
unsigned int i,j;
zap_channel_t *cur_chan = &cur_span->channels[j];
if (zap_test_flag(cur_chan, ZAP_CHANNEL_CONFIGURED)) {
zap_log(ZAP_LOG_INFO, "Closing channel %u:%u fd:%d\n", cur_chan->span_id, cur_chan->chan_id, cur_chan->sockfd);
- zap_wanpipe_socket_close(cur_chan->sockfd);
+ tdmv_api_close_socket(cur_chan->sockfd);
}
}
}