mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-16 12:10:46 +01:00
Merge pull request #5684 from rsyslog/codex/fix-data-race-reported-by-threadsanitizer
Fix race in notifyReArm
This commit is contained in:
commit
0ebc980309
@ -836,10 +836,12 @@ static rsRetVal
|
||||
notifyReArm(tcpsrv_io_descr_t *const pioDescr)
|
||||
{
|
||||
DEFiRet;
|
||||
|
||||
const unsigned waitIOEvent = (pioDescr->ioDirection == NSDSEL_WR) ? EPOLLOUT : EPOLLIN;
|
||||
pioDescr->event.events = waitIOEvent | EPOLLET | EPOLLONESHOT;
|
||||
if(epoll_ctl(pioDescr->pSrv->evtdata.epoll.efd, EPOLL_CTL_MOD, pioDescr->sock, &pioDescr->event) < 0) {
|
||||
struct epoll_event event = {
|
||||
.events = waitIOEvent | EPOLLET | EPOLLONESHOT,
|
||||
.data = { .ptr = pioDescr }
|
||||
};
|
||||
if(epoll_ctl(pioDescr->pSrv->evtdata.epoll.efd, EPOLL_CTL_MOD, pioDescr->sock, &event) < 0) {
|
||||
LogError(errno, RS_RET_ERR_EPOLL_CTL, "epoll_ctl failed re-armed socket %d", pioDescr->sock);
|
||||
ABORT_FINALIZE(RS_RET_ERR_EPOLL_CTL);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user