Permalink
Browse files

read-events: Advance the buffer pointer, not just create N first events.

Patch by Pawel Turnau.
  • Loading branch information...
1 parent b179eb0 commit b09c0d9c5decc9c670f56598383ffe6e80764806 @stassats committed Jan 30, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 inotify.lisp
View
@@ -136,15 +136,15 @@
(defun read-events (inotify)
(let* ((buffer (inotify-buffer inotify))
(bytes-read
- (isys:repeat-upon-eintr
- (isys:read (inotify-fd inotify)
- buffer
- (inotify-buffer-size inotify)))))
+ (isys:repeat-upon-eintr
+ (isys:read (inotify-fd inotify)
+ buffer
+ (inotify-buffer-size inotify)))))
(loop with event and event-length
for offset = 0 then (+ offset event-length)
while (< offset bytes-read)
do (setf (values event event-length)
- (read-event inotify buffer))
+ (read-event inotify (inc-pointer buffer offset)))
collect event)))
(defun make-inotify-with-watches (paths-with-masks)

0 comments on commit b09c0d9

Please sign in to comment.