summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-12-05 13:54:49 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-12-05 13:54:49 +0100
commitfe9d674f431957f4068e5ad512abd7db4cf7cd35 (patch)
treeed2f03f3a524ed9ac771872cbd96b52a41a11f80
parent5387e90765707cc14c8d6d010134ec8c452570f7 (diff)
downloadsocket_wrapper-fe9d674f431957f4068e5ad512abd7db4cf7cd35.tar.gz
socket_wrapper-fe9d674f431957f4068e5ad512abd7db4cf7cd35.tar.xz
socket_wrapper-fe9d674f431957f4068e5ad512abd7db4cf7cd35.zip
swrap: Use swrap structure for writev.
-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 1035ecd..4009608 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 ssize_t (*libc_writev)(int fd, const struct iovec *iov, int iovcnt);
-
-static ssize_t real_writev(int fd, const struct iovec *iov, int iovcnt)
-{
- if (libc_writev == NULL) {
- *(void **)(&libc_writev) = libc_dlsym("writev");
- }
-
- return libc_writev(fd, iov, iovcnt);
-}
-
/*********************************************************
* SWRAP HELPER FUNCTIONS
*********************************************************/
@@ -3163,7 +3152,7 @@ static ssize_t swrap_writev(int s, const struct iovec *vector, int count)
struct socket_info *si = find_socket_info(s);
if (!si) {
- return real_writev(s, vector, count);
+ return swrap.fns.libc_writev(s, vector, count);
}
tmp.iov_base = NULL;
@@ -3183,7 +3172,7 @@ static ssize_t swrap_writev(int s, const struct iovec *vector, int count)
ret = swrap_sendmsg_before(s, si, &msg, &tmp, &un_addr, NULL, NULL, NULL);
if (ret == -1) return -1;
- ret = real_writev(s, msg.msg_iov, msg.msg_iovlen);
+ ret = swrap.fns.libc_writev(s, msg.msg_iov, msg.msg_iovlen);
swrap_sendmsg_after(si, &msg, NULL, ret);