summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Martini <seb@dbzteam.org>2011-12-02 00:21:41 +0100
committerSebastien Martini <seb@dbzteam.org>2011-12-02 00:21:41 +0100
commit43f47fed3a28b7cd62cfcf1bcfa948d7499a0407 (patch)
treeaace43e30c4ade7c89a81f2963ed0cda1ee12c42
parent6bee47701efa5613605988af10593a3c69682ba3 (diff)
downloadpyinotify-43f47fed3a28b7cd62cfcf1bcfa948d7499a0407.tar.gz
Correctly handle IN_Q_OVERFLOW events.
This commit should fix a regression introduced with commit d334049eed6b1136a9d224a3ca17aa66fea5215a. Issue reported by Tomi Belan @TomiBelan.
-rwxr-xr-xpython2/pyinotify.py8
-rwxr-xr-xpython3/pyinotify.py8
2 files changed, 8 insertions, 8 deletions
diff --git a/python2/pyinotify.py b/python2/pyinotify.py
index 27f0f4e..ec99b71 100755
--- a/python2/pyinotify.py
+++ b/python2/pyinotify.py
@@ -1281,10 +1281,10 @@ class Notifier:
while self._eventq:
raw_event = self._eventq.popleft() # pop next event
watch_ = self._watch_manager.get_watch(raw_event.wd)
- if watch_ is None:
- # Not really sure how we ended up here, nor how we should
- # handle these types of events and if it is appropriate to
- # completly skip them (like we are doing here).
+ # Not really sure how we ended up here, nor how we should
+ # handle these types of events and if it is appropriate to
+ # completly skip them (like we are doing here).
+ if (watch_ is None) and not (raw_event.mask & IN_Q_OVERFLOW):
if not (raw_event.mask & IN_IGNORED):
log.warning("Unable to retrieve Watch object associated to %s",
repr(raw_event))
diff --git a/python3/pyinotify.py b/python3/pyinotify.py
index 44ab71f..a048493 100755
--- a/python3/pyinotify.py
+++ b/python3/pyinotify.py
@@ -1263,10 +1263,10 @@ class Notifier:
while self._eventq:
raw_event = self._eventq.popleft() # pop next event
watch_ = self._watch_manager.get_watch(raw_event.wd)
- if watch_ is None:
- # Not really sure how we ended up here, nor how we should
- # handle these types of events and if it is appropriate to
- # completly skip them (like we are doing here).
+ # Not really sure how we ended up here, nor how we should
+ # handle these types of events and if it is appropriate to
+ # completly skip them (like we are doing here).
+ if (watch_ is None) and not (raw_event.mask & IN_Q_OVERFLOW):
if not (raw_event.mask & IN_IGNORED):
log.warning("Unable to retrieve Watch object associated to %s",
repr(raw_event))