From c35c7df103c0af298785dd06ad08bad8a8dad479 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 2 Mar 2013 12:11:40 +0000 Subject: [PATCH] Don't give error message for non-existent paths in wxFileSystemWatcher. The file we're trying to watch might have been just deleted, this is an unavoidable (and not only in theory but also in practice when watching busy directories) race condition so don't give an error message if this does happen but simply return false from Add(). Closes #15051. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73591 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/fswatchercmn.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/fswatchercmn.cpp b/src/common/fswatchercmn.cpp index ce36aa2783..51d9d578f8 100644 --- a/src/common/fswatchercmn.cpp +++ b/src/common/fswatchercmn.cpp @@ -100,7 +100,10 @@ bool wxFileSystemWatcherBase::Add(const wxFileName& path, int events) } else { - wxLogError(_("Can't monitor non-existent path \"%s\" for changes."), + // Don't overreact to being passed a non-existent item. It may have + // only just been deleted, in which case doing nothing is correct + wxLogTrace(wxTRACE_FSWATCHER, + "Can't monitor non-existent path \"%s\" for changes.", path.GetFullPath()); return false; } -- 2.47.2