diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-09-24 14:45:49 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-09-24 14:45:49 +0200 |
commit | 5c4d7c6625b373dab198690a273a5c074ee0eb4b (patch) | |
tree | 35146d004127abf2c0b96c7d20c5b5502034395d /plugin | |
parent | 14c767ca48d6a86a3d495476bb6b5999036e00af (diff) | |
download | mariadb-git-5c4d7c6625b373dab198690a273a5c074ee0eb4b.tar.gz |
portability fix: use SOCKET_SIZE_TYPE in the handlersocket plugin
Diffstat (limited to 'plugin')
4 files changed, 7 insertions, 4 deletions
diff --git a/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp b/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp index fa42f2b0914..85887d1d55c 100644 --- a/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp +++ b/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp @@ -63,7 +63,7 @@ struct hstcpsvr_conn : public dbcallback_i { public: auto_file fd; sockaddr_storage addr; - socklen_t addr_len; + size_socket addr_len; dbconnstate cstate; std::string err; size_t readsize; diff --git a/plugin/handler_socket/libhsclient/auto_addrinfo.hpp b/plugin/handler_socket/libhsclient/auto_addrinfo.hpp index c3ab64e8127..f0c07060be1 100644 --- a/plugin/handler_socket/libhsclient/auto_addrinfo.hpp +++ b/plugin/handler_socket/libhsclient/auto_addrinfo.hpp @@ -9,12 +9,15 @@ #ifndef DENA_AUTO_ADDRINFO_HPP #define DENA_AUTO_ADDRINFO_HPP +#include <my_config.h> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include "util.hpp" +typedef SOCKET_SIZE_TYPE size_socket; + namespace dena { struct auto_addrinfo : private noncopyable { diff --git a/plugin/handler_socket/libhsclient/socket.cpp b/plugin/handler_socket/libhsclient/socket.cpp index 5d84a7c4adf..0c4816589fa 100644 --- a/plugin/handler_socket/libhsclient/socket.cpp +++ b/plugin/handler_socket/libhsclient/socket.cpp @@ -172,7 +172,7 @@ socket_bind(auto_file& fd, const socket_args& args, std::string& err_r) int socket_accept(int listen_fd, auto_file& fd, const socket_args& args, - sockaddr_storage& addr_r, socklen_t& addrlen_r, std::string& err_r) + sockaddr_storage& addr_r, size_socket& addrlen_r, std::string& err_r) { fd.reset(accept(listen_fd, reinterpret_cast<sockaddr *>(&addr_r), &addrlen_r)); diff --git a/plugin/handler_socket/libhsclient/socket.hpp b/plugin/handler_socket/libhsclient/socket.hpp index 3da6020e843..c6e638c9c01 100644 --- a/plugin/handler_socket/libhsclient/socket.hpp +++ b/plugin/handler_socket/libhsclient/socket.hpp @@ -19,7 +19,7 @@ namespace dena { struct socket_args { sockaddr_storage addr; - socklen_t addrlen; + size_socket addrlen; int family; int socktype; int protocol; @@ -43,7 +43,7 @@ void ignore_sigpipe(); int socket_bind(auto_file& fd, const socket_args& args, std::string& err_r); int socket_connect(auto_file& fd, const socket_args& args, std::string& err_r); int socket_accept(int listen_fd, auto_file& fd, const socket_args& args, - sockaddr_storage& addr_r, socklen_t& addrlen_r, std::string& err_r); + sockaddr_storage& addr_r, size_socket& addrlen_r, std::string& err_r); }; |