1
1
forked from 0ad/0ad

fix: don't raise warnings when overwriting previous realDirectory (e.g. in the case of multiple mods mounting into the same directory) causes previous directory watches to be canceled

This was SVN commit r7202.
This commit is contained in:
janwas 2009-11-16 21:01:36 +00:00
parent 781538313c
commit 22ac887785

View File

@ -220,7 +220,7 @@ public:
return m_next; return m_next;
} }
//private: private:
IntrusiveLink* m_prev; IntrusiveLink* m_prev;
IntrusiveLink* m_next; IntrusiveLink* m_next;
}; };
@ -285,19 +285,25 @@ public:
LibError Poll(size_t& bytesTransferred, uintptr_t& key, OVERLAPPED*& ovl) LibError Poll(size_t& bytesTransferred, uintptr_t& key, OVERLAPPED*& ovl)
{ {
DWORD dwBytesTransferred = 0; for(;;) // don't return abort notifications to caller
ULONG_PTR ulKey = 0; {
ovl = 0; DWORD dwBytesTransferred = 0;
const DWORD timeout = 0; ULONG_PTR ulKey = 0;
const BOOL gotPacket = GetQueuedCompletionStatus(m_hIOCP, &dwBytesTransferred, &ulKey, &ovl, timeout); ovl = 0;
bytesTransferred = size_t(bytesTransferred); const DWORD timeout = 0;
key = uintptr_t(ulKey); const BOOL gotPacket = GetQueuedCompletionStatus(m_hIOCP, &dwBytesTransferred, &ulKey, &ovl, timeout);
if(gotPacket) bytesTransferred = size_t(bytesTransferred);
return INFO::OK; key = uintptr_t(ulKey);
if(GetLastError() == WAIT_TIMEOUT) if(gotPacket)
return ERR::AGAIN; // NOWARN return INFO::OK;
// else: there was actually an error
return LibError_from_GLE(); if(GetLastError() == WAIT_TIMEOUT)
return ERR::AGAIN; // NOWARN (nothing pending)
else if(GetLastError() == ERROR_OPERATION_ABORTED)
continue; // watch was canceled - ignore
else
return LibError_from_GLE(); // actual error
}
} }
private: private: