aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2017-07-18 12:53:03 +0200
committerAndreas Schneider <asn@samba.org>2018-05-02 14:23:34 +0200
commit203a2793dd67461e01cd4267a35bbdc0cb8a162d (patch)
tree370441dd2904a801f21f9d219bee95c82c6a69b6 /src
parent6661997701aef9f609465b3a1863cf03402bc06a (diff)
downloadsocket_wrapper-203a2793dd67461e01cd4267a35bbdc0cb8a162d.tar.gz
socket_wrapper-203a2793dd67461e01cd4267a35bbdc0cb8a162d.tar.xz
socket_wrapper-203a2793dd67461e01cd4267a35bbdc0cb8a162d.zip
swrap: Use swrap_get_socket_info inside socket_wrapper_first_free_index
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'src')
-rw-r--r--src/socket_wrapper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 12dfb74..74ff081 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -1365,6 +1365,7 @@ static unsigned int socket_wrapper_default_iface(void)
*/
static int socket_wrapper_first_free_index(void)
{
+ struct socket_info *si = NULL;
int next_free;
if (first_free == -1) {
@@ -1372,9 +1373,10 @@ static int socket_wrapper_first_free_index(void)
return -1;
}
- next_free = swrap_get_next_free(&sockets[first_free]);
- ZERO_STRUCT(sockets[first_free]);
- swrap_set_next_free(&sockets[first_free], next_free);
+ si = swrap_get_socket_info(first_free);
+ next_free = swrap_get_next_free(si);
+ ZERO_STRUCTP(si);
+ swrap_set_next_free(si, next_free);
return first_free;
}