// get watch entry for this event
wxFSWatchEntryDescriptors::iterator it = m_watchMap.find(inevt.wd);
- if (it == m_watchMap.end())
+
+ // wd will be -1 for IN_Q_OVERFLOW, which would trigger the wxFAIL_MSG
+ if (inevt.wd != -1)
{
- // 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
+ if (it == m_watchMap.end())
{
- wxFAIL_MSG("Event for unknown watch descriptor.");
- }
+ // 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;
+ // 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 flags = Native2WatcherFlags(nativeFlags);
wxString errMsg = GetErrorDescription(nativeFlags);
wxFileSystemWatcherEvent event(flags, errMsg);
SendEvent(event);
+ return;
}
+
+ wxFSWatchEntry& watch = *(it->second);
+
// Now IN_UNMOUNT. We must do so here, as it's not in the watch flags
if (nativeFlags & IN_UNMOUNT)
{