diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-05-02 14:53:07 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-05-02 14:53:07 +0100 |
commit | 14a450ad99698225bf37dff1833b313b78367184 (patch) | |
tree | f787cb0f04ac2efe4bc6c1afa6b2f7bc7b6c42f2 /src/libutil | |
parent | 1322f5b04556e4d51daaaf59bcf1f298aec6917e (diff) | |
download | rspamd-14a450ad99698225bf37dff1833b313b78367184.tar.gz rspamd-14a450ad99698225bf37dff1833b313b78367184.zip |
Make socket errors non fatal.
If it is impossible to create all sockets from a list of addrinfo treat
it as success if any of sockets have been created.
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libutil/util.c b/src/libutil/util.c index ec63cabb9..8d1a6353d 100644 --- a/src/libutil/util.c +++ b/src/libutil/util.c @@ -97,7 +97,8 @@ poll_sync_socket (gint fd, gint timeout, short events) } static gint -make_inet_socket (gint type, struct addrinfo *addr, gboolean is_server, gboolean async, GList **list) +make_inet_socket (gint type, struct addrinfo *addr, gboolean is_server, + gboolean async, GList **list) { gint fd, r, optlen, on = 1, s_error; struct addrinfo *cur; @@ -434,7 +435,7 @@ make_universal_sockets_list (const gchar *credits, guint16 port, if ((r = getaddrinfo (credits, portbuf, &hints, &res)) == 0) { r = make_inet_socket (type, res, is_server, async, &result); freeaddrinfo (res); - if (r == -1) { + if (result == NULL) { goto err; } } |