Skip to content

Commit

Permalink
Fix usage that includes timeout and read_delay
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerdahl committed Feb 18, 2020
1 parent 6400e08 commit 9d0ae85
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions inotify_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ def read(self, timeout=None, read_delay=None):
def _readall(self):
bytes_avail = c_int()
ioctl(self, FIONREAD, bytes_avail)
if bytes_avail.value:
return read(self.fileno(), bytes_avail.value)
if not bytes_avail.value:
return b''
return read(self.fileno(), bytes_avail.value)


def parse_events(data):
Expand Down

0 comments on commit 9d0ae85

Please sign in to comment.