mirror of
https://github.com/anope/anope.git
synced 2026-07-05 14:23:13 +02:00
Use clock_gettime if it is available.
This commit is contained in:
@@ -76,7 +76,7 @@ void SocketEngine::Process()
|
||||
events.resize(events.size() * 2);
|
||||
|
||||
int total = epoll_wait(EngineHandle, &events.front(), events.size(), Config->ReadTimeout * 1000);
|
||||
Anope::CurTime = time(NULL);
|
||||
Anope::UpdateTime();
|
||||
|
||||
/* EINTR can be given if the read timeout expires */
|
||||
if (total == -1)
|
||||
|
||||
@@ -77,7 +77,7 @@ void SocketEngine::Process()
|
||||
static timespec kq_timespec = { Config->ReadTimeout, 0 };
|
||||
int total = kevent(kq_fd, &change_events.front(), change_count, &event_events.front(), event_events.size(), &kq_timespec);
|
||||
change_count = 0;
|
||||
Anope::CurTime = time(NULL);
|
||||
Anope::UpdateTime();
|
||||
|
||||
/* EINTR can be given if the read timeout expires */
|
||||
if (total == -1)
|
||||
|
||||
@@ -100,7 +100,7 @@ void SocketEngine::Change(Socket *s, bool set, SocketFlag flag)
|
||||
void SocketEngine::Process()
|
||||
{
|
||||
int total = poll(&events.front(), events.size(), Config->ReadTimeout * 1000);
|
||||
Anope::CurTime = time(NULL);
|
||||
Anope::UpdateTime();
|
||||
|
||||
/* EINTR can be given if the read timeout expires */
|
||||
if (total < 0)
|
||||
|
||||
@@ -100,7 +100,7 @@ void SocketEngine::Process()
|
||||
#endif
|
||||
|
||||
int sresult = select(MaxFD + 1, &rfdset, &wfdset, &efdset, &tval);
|
||||
Anope::CurTime = time(NULL);
|
||||
Anope::UpdateTime();
|
||||
|
||||
if (sresult == -1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user