summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-12-09 19:24:30 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-12-09 19:29:35 +0100
commit84e6729c4946b7b154e90ea347fcdc5aa42dc4ee (patch)
treeaa2c8d820435111bcc97183854c305522396afa5
parent2cfbea1bf2ff5f1edf1512cea5fbb12e87e0a800 (diff)
downloadsocket_wrapper-84e6729c4946b7b154e90ea347fcdc5aa42dc4ee.zip
socket_wrapper-84e6729c4946b7b154e90ea347fcdc5aa42dc4ee.tar.gz
socket_wrapper-84e6729c4946b7b154e90ea347fcdc5aa42dc4ee.tar.xz
swrap: Add libc_dup().
-rw-r--r--src/socket_wrapper.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index d983a49..b7488a1 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -616,6 +616,13 @@ static int libc_connect(int sockfd,
return swrap.fns.libc_connect(sockfd, addr, addrlen);
}
+static int libc_dup(int fd)
+{
+ swrap_load_lib_function(SWRAP_LIBC, dup);
+
+ return swrap.fns.libc_dup(fd);
+}
+
static int libc_vioctl(int d, unsigned long int request, va_list ap)
{
long int args[4];
@@ -3327,7 +3334,7 @@ static int swrap_dup(int fd)
si = find_socket_info(fd);
if (!si) {
- return swrap.fns.libc_dup(fd);
+ return libc_dup(fd);
}
fi = (struct socket_info_fd *)calloc(1, sizeof(struct socket_info_fd));
@@ -3336,7 +3343,7 @@ static int swrap_dup(int fd)
return -1;
}
- fi->fd = swrap.fns.libc_dup(fd);
+ fi->fd = libc_dup(fd);
if (fi->fd == -1) {
int saved_errno = errno;
free(fi);