diff options
author | Patrick Sisterhen <patrick.sisterhen@ni.com> | 2014-03-14 17:57:41 -0500 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2014-03-16 17:30:37 +0100 |
commit | 140490649d0fd6fb5eee7109c02c35026a47b60c (patch) | |
tree | 8c0c50e47be2d0fa6da76394c04565533e5c78da /host/lib/transport | |
parent | da13adfd82b8b6cd638a4b6fcbd287647336570a (diff) | |
download | uhd-140490649d0fd6fb5eee7109c02c35026a47b60c.tar.gz uhd-140490649d0fd6fb5eee7109c02c35026a47b60c.tar.bz2 uhd-140490649d0fd6fb5eee7109c02c35026a47b60c.zip |
uhd: Fixed WSA bugs (superfluous %s, getsockopt parameters)
Diffstat (limited to 'host/lib/transport')
-rw-r--r-- | host/lib/transport/udp_wsa_zero_copy.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
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; } |