From: Vsevolod Stakhov Date: Fri, 2 May 2014 13:53:07 +0000 (+0100) Subject: Make socket errors non fatal. X-Git-Tag: 0.7.0~227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14a450ad99698225bf37dff1833b313b78367184;p=thirdparty%2Frspamd.git 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. --- diff --git a/interface b/interface index 6828f4735b..bb9d7a1072 160000 --- a/interface +++ b/interface @@ -1 +1 @@ -Subproject commit 6828f4735bb998f20b00e1b8d144aec5c102d947 +Subproject commit bb9d7a1072f76ec0ac3b7b9547b20040f39763a9 diff --git a/src/libutil/util.c b/src/libutil/util.c index ec63cabb97..8d1a6353de 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; } }