diff options
-rw-r--r-- | src/socket_wrapper.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 9f9b8b4..e298c31 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -758,6 +758,13 @@ static int libc_setsockopt(int sockfd, return swrap.fns.libc_setsockopt(sockfd, level, optname, optval, optlen); } +static int libc_socket(int domain, int type, int protocol) +{ + swrap_load_lib_function(SWRAP_LIBSOCKET, socket); + + return swrap.fns.libc_socket(domain, type, protocol); +} + /********************************************************* * SWRAP HELPER FUNCTIONS *********************************************************/ @@ -2012,7 +2019,7 @@ static int swrap_socket(int family, int type, int protocol) #endif if (!swrap_enabled()) { - return swrap.fns.libc_socket(family, type, protocol); + return libc_socket(family, type, protocol); } switch (family) { @@ -2022,7 +2029,7 @@ static int swrap_socket(int family, int type, int protocol) #endif break; case AF_UNIX: - return swrap.fns.libc_socket(family, type, protocol); + return libc_socket(family, type, protocol); default: errno = EAFNOSUPPORT; return -1; @@ -2060,7 +2067,7 @@ static int swrap_socket(int family, int type, int protocol) * We must call libc_socket with type, from the caller, not the version * we removed SOCK_CLOEXEC and SOCK_NONBLOCK from */ - fd = swrap.fns.libc_socket(AF_UNIX, type, 0); + fd = libc_socket(AF_UNIX, type, 0); if (fd == -1) return -1; |