DEBUG: fd: split the fd check

Split the BUG_ON(fd < 0 || fd >= global.maxsock) so it's easier to know
if it quits because of a -1.

(cherry picked from commit dc66f2f97d76613d732c49cc326791863b018f0e)
Signed-off-by: Willy Tarreau <w@1wt.eu>
This commit is contained in:
William Lallemand 2022-07-26 10:35:24 +02:00 committed by Willy Tarreau
parent befb887bb3
commit 425542423c

View File

@ -330,7 +330,8 @@ static inline void fd_insert(int fd, void *owner, void (*iocb)(int fd), unsigned
/* This must never happen and would definitely indicate a bug, in
* addition to overwriting some unexpected memory areas.
*/
BUG_ON(fd < 0 || fd >= global.maxsock);
BUG_ON(fd < 0);
BUG_ON(fd >= global.maxsock);
BUG_ON(fdtab[fd].owner != NULL);
BUG_ON(fdtab[fd].state != 0);