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.
This commit is contained in:
Willy Tarreau 2019-08-30 14:36:10 +02:00
parent 76913d3ef4
commit d660990cee

View File

@ -127,6 +127,7 @@ struct fdtab {
unsigned char ev; /* event seen in return of poll() : FD_POLL_* */ 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 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 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 #ifdef USE_THREAD
/* only align on cache lines when using threads; 32-bit small archs /* only align on cache lines when using threads; 32-bit small archs