summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-12-09 19:18:39 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-12-09 19:29:34 +0100
commitf3b03d777e9da4fb70360219bd0ef4535028971e (patch)
tree9f503707c2c0dd6399cd09f2347450107682c960 /src
parentf7d9020866f64b266faf519d5175b01a6e178a50 (diff)
downloadsocket_wrapper-f3b03d777e9da4fb70360219bd0ef4535028971e.tar.gz
socket_wrapper-f3b03d777e9da4fb70360219bd0ef4535028971e.tar.xz
socket_wrapper-f3b03d777e9da4fb70360219bd0ef4535028971e.zip
swrap: Add libc_close().
Diffstat (limited to 'src')
-rw-r--r--src/socket_wrapper.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 81f77e5..883fc72 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -600,6 +600,13 @@ static int libc_bind(int sockfd,
return swrap.fns.libc_bind(sockfd, addr, addrlen);
}
+static int libc_close(int fd)
+{
+ swrap_load_lib_function(SWRAP_LIBC, close);
+
+ return swrap.fns.libc_close(fd);
+}
+
static int libc_vioctl(int d, unsigned long int request, va_list ap)
{
long int args[4];
@@ -3254,7 +3261,7 @@ static int swrap_close(int fd)
int ret;
if (!si) {
- return swrap.fns.libc_close(fd);
+ return libc_close(fd);
}
for (fi = si->fds; fi; fi = fi->next) {
@@ -3267,7 +3274,7 @@ static int swrap_close(int fd)
if (si->fds) {
/* there are still references left */
- return swrap.fns.libc_close(fd);
+ return libc_close(fd);
}
SWRAP_DLIST_REMOVE(sockets, si);
@@ -3276,7 +3283,7 @@ static int swrap_close(int fd)
swrap_dump_packet(si, NULL, SWRAP_CLOSE_SEND, NULL, 0);
}
- ret = swrap.fns.libc_close(fd);
+ ret = libc_close(fd);
if (si->myname && si->peername) {
swrap_dump_packet(si, NULL, SWRAP_CLOSE_RECV, NULL, 0);