MINOR: cli/show-fd: slightly reorganize the FD status flags

Slightly reorder the status flags to better match their order in the
"state" field, and also decode the "shut" state which is particularly
useful and already part of this field.
This commit is contained in:
Willy Tarreau 2021-04-07 08:48:12 +02:00
parent 1673c4a883
commit 184b21259b

View File

@ -1190,20 +1190,22 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
suspicious = 1;
chunk_printf(&trash,
" %5d : st=0x%06x(R:%c%c W:%c%c %c%c%c%c%c %c%c) tmask=0x%lx umask=0x%lx owner=%p iocb=%p(",
" %5d : st=0x%06x(%c%c %c%c%c%c%c W:%c%c%c R:%c%c%c) tmask=0x%lx umask=0x%lx owner=%p iocb=%p(",
fd,
fdt.state,
(fdt.state & FD_EV_READY_R) ? 'R' : 'r',
(fdt.state & FD_EV_ACTIVE_R) ? 'A' : 'a',
(fdt.state & FD_EV_READY_W) ? 'R' : 'r',
(fdt.state & FD_EV_ACTIVE_W) ? 'A' : 'a',
(fdt.state & FD_CLONED) ? 'C' : 'c',
(fdt.state & FD_LINGER_RISK) ? 'L' : 'l',
(fdt.state & FD_POLL_HUP) ? 'H' : 'h',
(fdt.state & FD_POLL_ERR) ? 'E' : 'e',
(fdt.state & FD_POLL_OUT) ? 'O' : 'o',
(fdt.state & FD_POLL_PRI) ? 'P' : 'p',
(fdt.state & FD_POLL_IN) ? 'I' : 'i',
(fdt.state & FD_LINGER_RISK) ? 'L' : 'l',
(fdt.state & FD_CLONED) ? 'C' : 'c',
(fdt.state & FD_EV_SHUT_W) ? 'S' : 's',
(fdt.state & FD_EV_READY_W) ? 'R' : 'r',
(fdt.state & FD_EV_ACTIVE_W) ? 'A' : 'a',
(fdt.state & FD_EV_SHUT_R) ? 'S' : 's',
(fdt.state & FD_EV_READY_R) ? 'R' : 'r',
(fdt.state & FD_EV_ACTIVE_R) ? 'A' : 'a',
fdt.thread_mask, fdt.update_mask,
fdt.owner,
fdt.iocb);