Permalink
Browse files

Make CFFI happy with structs.

  • Loading branch information...
1 parent b09c0d9 commit cb4e78f1da0fcceb41e5ae591ff969bc07bca088 @stassats committed Mar 25, 2013
Showing with 4 additions and 2 deletions.
  1. +2 −0 inotify.asd
  2. +2 −2 inotify.lisp
View
@@ -5,6 +5,8 @@
(asdf:defsystem #:inotify
:depends-on (cffi iolib)
+ :license "Public Domain"
+ :description "Interface to linux inotify(7)"
:serial t
:components ((:file "packages")
(cffi-grovel:grovel-file "grovel")
View
@@ -121,14 +121,14 @@
(defun read-event (inotify buffer)
(with-foreign-slots ((watch mask cookie name-length)
- buffer inotify-event)
+ buffer (:struct inotify-event))
(let ((event (make-event :watch (find-watch inotify watch)
:mask mask
:cookie cookie)))
(unless (zerop name-length)
(setf (event-name event)
(foreign-string-to-lisp
- (foreign-slot-pointer buffer 'inotify-event 'name)
+ (foreign-slot-pointer buffer '(:struct inotify-event) 'name)
:max-chars name-length)))
(values event
(+ +event-size+ name-length)))))

0 comments on commit cb4e78f

Please sign in to comment.