summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-12-09 19:25:43 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-12-09 19:29:35 +0100
commit999ace2a21cd6793d3502321ab0fd961e8c80f65 (patch)
tree8e12b63d30120c7a681eeb6262b46db10dcb354f
parent84e6729c4946b7b154e90ea347fcdc5aa42dc4ee (diff)
downloadsocket_wrapper-999ace2a21cd6793d3502321ab0fd961e8c80f65.tar.gz
socket_wrapper-999ace2a21cd6793d3502321ab0fd961e8c80f65.tar.xz
socket_wrapper-999ace2a21cd6793d3502321ab0fd961e8c80f65.zip
swrap: Add libc_dup2().
-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 b7488a1..c054f36 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -623,6 +623,13 @@ static int libc_dup(int fd)
return swrap.fns.libc_dup(fd);
}
+static int libc_dup2(int oldfd, int newfd)
+{
+ swrap_load_lib_function(SWRAP_LIBC, dup2);
+
+ return swrap.fns.libc_dup2(oldfd, newfd);
+}
+
static int libc_vioctl(int d, unsigned long int request, va_list ap)
{
long int args[4];
@@ -3372,7 +3379,7 @@ static int swrap_dup2(int fd, int newfd)
si = find_socket_info(fd);
if (!si) {
- return swrap.fns.libc_dup2(fd, newfd);
+ return libc_dup2(fd, newfd);
}
if (find_socket_info(newfd)) {
@@ -3387,7 +3394,7 @@ static int swrap_dup2(int fd, int newfd)
return -1;
}
- fi->fd = swrap.fns.libc_dup2(fd, newfd);
+ fi->fd = libc_dup2(fd, newfd);
if (fi->fd == -1) {
int saved_errno = errno;
free(fi);