From 140490649d0fd6fb5eee7109c02c35026a47b60c Mon Sep 17 00:00:00 2001 From: Patrick Sisterhen Date: Fri, 14 Mar 2014 17:57:41 -0500 Subject: uhd: Fixed WSA bugs (superfluous %s, getsockopt parameters) --- host/lib/transport/udp_wsa_zero_copy.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'host/lib/transport') diff --git a/host/lib/transport/udp_wsa_zero_copy.cpp b/host/lib/transport/udp_wsa_zero_copy.cpp index 23ccf7975..52382f84d 100644 --- a/host/lib/transport/udp_wsa_zero_copy.cpp +++ b/host/lib/transport/udp_wsa_zero_copy.cpp @@ -279,12 +279,13 @@ public: //! Read back the socket's buffer space reserved for receives size_t get_recv_buff_size(void) { int recv_buff_size = 0; + int opt_len = sizeof(recv_buff_size); getsockopt( _sock_fd, SOL_SOCKET, SO_RCVBUF, - (const char *)&recv_buff_size, - sizeof(recv_buff_size) + (char *)&recv_buff_size, + (int *)&opt_len ); return (size_t) recv_buff_size; @@ -293,12 +294,13 @@ public: //! Read back the socket's buffer space reserved for sends size_t get_send_buff_size(void) { int send_buff_size = 0; + int opt_len = sizeof(send_buff_size); getsockopt( _sock_fd, SOL_SOCKET, SO_SNDBUF, - (const char *)&send_buff_size, - sizeof(send_buff_size) + (char *)&send_buff_size, + (int *)&opt_len ); return (size_t) send_buff_size; @@ -333,7 +335,7 @@ void check_usr_buff_size( "The %s buffer could not be resized sufficiently.\n" "Target sock buff size: %d bytes.\n" "Actual sock buff size: %d bytes.\n" - "See the transport application notes on buffer resizing.\n%s" + "See the transport application notes on buffer resizing.\n" ) % tx_rx % user_buff_size % actual_buff_size; } -- cgit v1.2.3