]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: select: enhance readability in init
authorWilliam Dauchy <w.dauchy@criteo.com>
Mon, 11 May 2020 13:20:05 +0000 (15:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 May 2020 09:52:30 +0000 (11:52 +0200)
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>
src/ev_select.c

index acfdbb94a295ace15ba2396fd499b23628aad87c..d02669f0f62d79753bb6cd527d2232f651798c44 100644 (file)
@@ -225,9 +225,11 @@ static int init_select_per_thread()
        int fd_set_bytes;
 
        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;
-       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;
        return 1;
   fail:
@@ -238,8 +240,10 @@ static int init_select_per_thread()
 
 static void deinit_select_per_thread()
 {
-       free(tmp_evts[DIR_WR]); tmp_evts[DIR_WR] = NULL;
-       free(tmp_evts[DIR_RD]); tmp_evts[DIR_RD] = NULL;
+       free(tmp_evts[DIR_WR]);
+       tmp_evts[DIR_WR] = NULL;
+       free(tmp_evts[DIR_RD]);
+       tmp_evts[DIR_RD] = NULL;
 }
 
 /*