Mercurial > dovecot > core-2.2
changeset 11879:4fb7e5327efc
net_connect_ip*(): Fixed FreeBSD kludging.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 21 Jul 2010 00:15:34 +0100 |
parents | 4ffc063a5eff |
children | e3519ec18f03 |
files | src/lib/network.c |
diffstat | 1 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/network.c Tue Jul 20 21:53:29 2010 +0100 +++ b/src/lib/network.c Wed Jul 21 00:15:34 2010 +0100 @@ -135,16 +135,17 @@ } #ifdef __FreeBSD__ -static int net_connect_ip_freebsd(const struct ip_addr *ip, unsigned int port, - const struct ip_addr *my_ip); +static int +net_connect_ip_full_freebsd(const struct ip_addr *ip, unsigned int port, + const struct ip_addr *my_ip, bool blocking); -int net_connect_ip(const struct ip_addr *ip, unsigned int port, - const struct ip_addr *my_ip) +static int net_connect_ip_full(const struct ip_addr *ip, unsigned int port, + const struct ip_addr *my_ip, bool blocking) { int fd, try; for (try = 0;;) { - fd = net_connect_ip_freebsd(ip, port, my_ip); + fd = net_connect_ip_full_freebsd(ip, port, my_ip, blocking); if (fd != -1 || ++try == 5 || (errno != EADDRINUSE && errno != EACCES)) break; @@ -159,8 +160,7 @@ return fd; } /* then some kludging: */ -#define net_connect_ip net_connect_ip_freebsd -static +#define net_connect_ip_full net_connect_ip_full_freebsd #endif static int net_connect_ip_full(const struct ip_addr *ip, unsigned int port, @@ -217,6 +217,9 @@ return fd; } +#ifdef __FreeBSD__ +# undef net_connect_ip_full +#endif int net_connect_ip(const struct ip_addr *ip, unsigned int port, const struct ip_addr *my_ip)