Correct handling of IN_Q_OVERFLOW in wxFileSystemWatcher Linux code.
Don't use wd field if it's -1 which can happen for IN_Q_OVERFLOW. See #14854. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -236,25 +236,29 @@ protected:
|
|||||||
|
|
||||||
// get watch entry for this event
|
// get watch entry for this event
|
||||||
wxFSWatchEntryDescriptors::iterator it = m_watchMap.find(inevt.wd);
|
wxFSWatchEntryDescriptors::iterator it = m_watchMap.find(inevt.wd);
|
||||||
if (it == m_watchMap.end())
|
|
||||||
{
|
|
||||||
// It's not in the map; check if was recently removed from it.
|
|
||||||
if (m_staleDescriptors.Index(inevt.wd) != wxNOT_FOUND)
|
|
||||||
{
|
|
||||||
wxLogTrace(wxTRACE_FSWATCHER,
|
|
||||||
"Got an event for stale wd %i", inevt.wd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wxFAIL_MSG("Event for unknown watch descriptor.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// In any case, don't process this event: it's either for an
|
// wd will be -1 for IN_Q_OVERFLOW, which would trigger the wxFAIL_MSG
|
||||||
// already removed entry, or for a completely unknown one.
|
if (inevt.wd != -1)
|
||||||
return;
|
{
|
||||||
|
if (it == m_watchMap.end())
|
||||||
|
{
|
||||||
|
// It's not in the map; check if was recently removed from it.
|
||||||
|
if (m_staleDescriptors.Index(inevt.wd) != wxNOT_FOUND)
|
||||||
|
{
|
||||||
|
wxLogTrace(wxTRACE_FSWATCHER,
|
||||||
|
"Got an event for stale wd %i", inevt.wd);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxFAIL_MSG("Event for unknown watch descriptor.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// In any case, don't process this event: it's either for an
|
||||||
|
// already removed entry, or for a completely unknown one.
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFSWatchEntry& watch = *(it->second);
|
|
||||||
int nativeFlags = inevt.mask;
|
int nativeFlags = inevt.mask;
|
||||||
int flags = Native2WatcherFlags(nativeFlags);
|
int flags = Native2WatcherFlags(nativeFlags);
|
||||||
|
|
||||||
@@ -264,7 +268,11 @@ protected:
|
|||||||
wxString errMsg = GetErrorDescription(nativeFlags);
|
wxString errMsg = GetErrorDescription(nativeFlags);
|
||||||
wxFileSystemWatcherEvent event(flags, errMsg);
|
wxFileSystemWatcherEvent event(flags, errMsg);
|
||||||
SendEvent(event);
|
SendEvent(event);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxFSWatchEntry& watch = *(it->second);
|
||||||
|
|
||||||
// Now IN_UNMOUNT. We must do so here, as it's not in the watch flags
|
// Now IN_UNMOUNT. We must do so here, as it's not in the watch flags
|
||||||
if (nativeFlags & IN_UNMOUNT)
|
if (nativeFlags & IN_UNMOUNT)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user