Make failure to remove an inotify watch a warning
Apparently this can happen when a directory is deleted just before the watch
is removed and it is impossible to avoid it, so just send a warning message so
that the program could react to this, if necessary, but don't annoy the user
with an error in this case.
See #17122.
(cherry picked from commit 6537356236
)
This commit is contained in:
committed by
Vadim Zeitlin
parent
7c540fd007
commit
07168e3d2a
@@ -129,8 +129,20 @@ public:
|
|||||||
int ret = DoRemoveInotify(watch.get());
|
int ret = DoRemoveInotify(watch.get());
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
{
|
{
|
||||||
wxLogSysError( _("Unable to remove inotify watch") );
|
// Failures can happen if a dir is deleted just before we try to
|
||||||
return false;
|
// remove the watch. I think there's a race between calling this
|
||||||
|
// code and IN_DELETE_SELF arriving. So just warn.
|
||||||
|
wxFileSystemWatcherEvent
|
||||||
|
event
|
||||||
|
(
|
||||||
|
wxFSW_EVENT_WARNING, wxFSW_WARNING_GENERAL,
|
||||||
|
wxString::Format
|
||||||
|
(
|
||||||
|
_("Unable to remove inotify watch %i"),
|
||||||
|
watch->GetWatchDescriptor()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
SendEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_watchMap.erase(watch->GetWatchDescriptor()) != 1)
|
if (m_watchMap.erase(watch->GetWatchDescriptor()) != 1)
|
||||||
|
Reference in New Issue
Block a user