From 184b21259b8801354a6aa60f954d5153812036d0 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 7 Apr 2021 08:48:12 +0200 Subject: [PATCH] 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. --- src/cli.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/cli.c b/src/cli.c index 575a1730e..5f370147a 100644 --- a/src/cli.c +++ b/src/cli.c @@ -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);