mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-05-11 20:28:13 +00:00
BUG/MINOR: reload: do not fail when no socket is sent
get_old_sockets() mistakenly sets ret=0 instead of ret2=0 before leaving when the old process announces zero FD. So it will return an error instead of success. This must be particularly rare not to have a single socket to offer though! A few comments were added to make it more obvious what to expect in return. This must be backported to 1.8 since the bug has always been there.
This commit is contained in:
parent
c32f39431c
commit
febbce87ba
@ -1122,6 +1122,10 @@ next_dir_entry:
|
|||||||
free(err);
|
free(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Retrieves old sockets from worker process running the CLI at address
|
||||||
|
* <unixsocket>. Fills xfer_sock_list with what is found. Returns 0 on
|
||||||
|
* success, -1 on failure.
|
||||||
|
*/
|
||||||
static int get_old_sockets(const char *unixsocket)
|
static int get_old_sockets(const char *unixsocket)
|
||||||
{
|
{
|
||||||
char *cmsgbuf = NULL, *tmpbuf = NULL;
|
char *cmsgbuf = NULL, *tmpbuf = NULL;
|
||||||
@ -1173,7 +1177,7 @@ static int get_old_sockets(const char *unixsocket)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (fd_nb == 0) {
|
if (fd_nb == 0) {
|
||||||
ret = 0;
|
ret2 = 0;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
tmpbuf = malloc(fd_nb * (1 + MAXPATHLEN + 1 + IFNAMSIZ + sizeof(int)));
|
tmpbuf = malloc(fd_nb * (1 + MAXPATHLEN + 1 + IFNAMSIZ + sizeof(int)));
|
||||||
|
Loading…
Reference in New Issue
Block a user