diff --git a/include/haproxy/fd-t.h b/include/haproxy/fd-t.h index 53bc528a6..27266dce9 100644 --- a/include/haproxy/fd-t.h +++ b/include/haproxy/fd-t.h @@ -36,11 +36,11 @@ enum { * FD_POLL_OUT remains set as long as the fd accepts to write data. * FD_POLL_ERR and FD_POLL_ERR remain set forever (until processed). */ -#define FD_POLL_IN 0x01 -#define FD_POLL_PRI 0x02 -#define FD_POLL_OUT 0x04 -#define FD_POLL_ERR 0x08 -#define FD_POLL_HUP 0x10 +#define FD_POLL_IN 0x00000100 +#define FD_POLL_PRI 0x00000200 +#define FD_POLL_OUT 0x00000400 +#define FD_POLL_ERR 0x00000800 +#define FD_POLL_HUP 0x00001000 #define FD_POLL_UPDT_MASK (FD_POLL_IN | FD_POLL_PRI | FD_POLL_OUT) @@ -128,7 +128,7 @@ struct fdtab { void (*iocb)(int fd); /* I/O handler */ void *owner; /* the connection or listener associated with this fd, NULL if closed */ unsigned char state; /* FD state for read and write directions (FD_EV_*) */ - unsigned char ev; /* event seen in return of poll() : FD_POLL_* */ + unsigned int ev; /* event seen in return of poll() : FD_POLL_* */ unsigned char linger_risk:1; /* 1 if we must kill lingering before closing */ unsigned char cloned:1; /* 1 if a cloned socket, requires EPOLL_CTL_DEL on close */ unsigned char initialized:1; /* 1 if init phase was done on this fd (e.g. set non-blocking) */ diff --git a/include/haproxy/fd.h b/include/haproxy/fd.h index 09fe24cfd..4863c4aa2 100644 --- a/include/haproxy/fd.h +++ b/include/haproxy/fd.h @@ -354,11 +354,11 @@ static inline long fd_clr_running(int fd) * doesn't need to also pass FD_EV_SHUT_*, it's implied. ERR and SHUT are * allowed to be reported regardless of R/W readiness. */ -static inline void fd_update_events(int fd, unsigned char evts) +static inline void fd_update_events(int fd, uint evts) { unsigned long locked = atleast2(fdtab[fd].thread_mask); - unsigned char old, new; - int new_flags, must_stop; + uint old, new; + uint new_flags, must_stop; new_flags = ((evts & FD_EV_READY_R) ? FD_POLL_IN : 0) | diff --git a/src/cli.c b/src/cli.c index 2e4da522f..1e4520353 100644 --- a/src/cli.c +++ b/src/cli.c @@ -1197,7 +1197,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx) (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.ev, + fdt.ev >> 8, (fdt.ev & FD_POLL_HUP) ? 'H' : 'h', (fdt.ev & FD_POLL_ERR) ? 'E' : 'e', (fdt.ev & FD_POLL_OUT) ? 'O' : 'o',