From d660990cee7227fb052047ac3925af5950dfc62d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 30 Aug 2019 14:36:10 +0200 Subject: [PATCH] MINOR: fd: add a new "initialized" bit in the fdtab struct The purpose is to be able to remember that initialization was already done for a file descriptor. This will allow to get rid of some dirty hacks performed in the logs or fd sinks where the init state of the fd has to be guessed. --- include/types/fd.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/types/fd.h b/include/types/fd.h index 35d3bc237..b96abc09d 100644 --- a/include/types/fd.h +++ b/include/types/fd.h @@ -127,6 +127,7 @@ struct fdtab { unsigned char 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) */ } #ifdef USE_THREAD /* only align on cache lines when using threads; 32-bit small archs