summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-12-05 12:18:31 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-12-05 13:43:45 +0100
commit134903a7c4622a7971e7d4cc7f0fbfc1350beb82 (patch)
tree40fc050518d853f9091868548824aa08fa889de1
parenta1e494ba5d4a7badafc0c3debfddfd9f6d3e4e61 (diff)
downloadsocket_wrapper-134903a7c4622a7971e7d4cc7f0fbfc1350beb82.zip
socket_wrapper-134903a7c4622a7971e7d4cc7f0fbfc1350beb82.tar.gz
socket_wrapper-134903a7c4622a7971e7d4cc7f0fbfc1350beb82.tar.xz
swrap: Use swrap structure for listen.
-rw-r--r--src/socket_wrapper.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 2f2fc1a..50eb4b9 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -561,17 +561,6 @@ static int libc_vioctl(int d, unsigned long int request, va_list ap)
return rc;
}
-static int (*libc_listen)(int sockfd, int backlog);
-
-static int real_listen(int sockfd, int backlog)
-{
- if (libc_listen == NULL) {
- *(void **)(&libc_listen) = libc_dlsym("listen");
- }
-
- return libc_listen(sockfd, backlog);
-}
-
static int (*libc_read)(int fd, void *buf, size_t count);
static int real_read(int fd, void *buf, size_t count)
@@ -2423,10 +2412,10 @@ static int swrap_listen(int s, int backlog)
struct socket_info *si = find_socket_info(s);
if (!si) {
- return real_listen(s, backlog);
+ return swrap.fns.libc_listen(s, backlog);
}
- ret = real_listen(s, backlog);
+ ret = swrap.fns.libc_listen(s, backlog);
return ret;
}