mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
CLEANUP: select: enhance readability in init
while reading the code, I thought it was clearer to put one instruction per line as it is mostly done elsewhere Signed-off-by: William Dauchy <w.dauchy@criteo.com>
This commit is contained in:
parent
42a50bd19b
commit
32fba0a629
@ -225,9 +225,11 @@ static int init_select_per_thread()
|
|||||||
int fd_set_bytes;
|
int fd_set_bytes;
|
||||||
|
|
||||||
fd_set_bytes = sizeof(fd_set) * (global.maxsock + FD_SETSIZE - 1) / FD_SETSIZE;
|
fd_set_bytes = sizeof(fd_set) * (global.maxsock + FD_SETSIZE - 1) / FD_SETSIZE;
|
||||||
if ((tmp_evts[DIR_RD] = (fd_set *)calloc(1, fd_set_bytes)) == NULL)
|
tmp_evts[DIR_RD] = (fd_set *)calloc(1, fd_set_bytes);
|
||||||
|
if (tmp_evts[DIR_RD] == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
if ((tmp_evts[DIR_WR] = (fd_set *)calloc(1, fd_set_bytes)) == NULL)
|
tmp_evts[DIR_WR] = (fd_set *)calloc(1, fd_set_bytes);
|
||||||
|
if (tmp_evts[DIR_WR] == NULL)
|
||||||
goto fail;
|
goto fail;
|
||||||
return 1;
|
return 1;
|
||||||
fail:
|
fail:
|
||||||
@ -238,8 +240,10 @@ static int init_select_per_thread()
|
|||||||
|
|
||||||
static void deinit_select_per_thread()
|
static void deinit_select_per_thread()
|
||||||
{
|
{
|
||||||
free(tmp_evts[DIR_WR]); tmp_evts[DIR_WR] = NULL;
|
free(tmp_evts[DIR_WR]);
|
||||||
free(tmp_evts[DIR_RD]); tmp_evts[DIR_RD] = NULL;
|
tmp_evts[DIR_WR] = NULL;
|
||||||
|
free(tmp_evts[DIR_RD]);
|
||||||
|
tmp_evts[DIR_RD] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user