Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion python2/pyinotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,9 @@ def read_events(self):
"""
buf_ = array.array('i', [0])
# get event queue size
if fcntl.ioctl(self._fd, termios.FIONREAD, buf_, 1) == -1:
# don't pass `mutate_flag` to the `fcntl.ioctl`, it may cause segfault on some
# systems, e.g. alpine linux (see https://bugs.alpinelinux.org/issues/5981)
if fcntl.ioctl(self._fd, termios.FIONREAD, buf_) == -1:
return
queue_size = buf_[0]
if queue_size < self._threshold:
Expand Down