diff --git a/cffi-epoll.lisp b/cffi-epoll.lisp
index 8251c84..0fc2aee 100644
--- a/cffi-epoll.lisp
+++ b/cffi-epoll.lisp
@@ -31,7 +31,7 @@
(let ((fd (gensym "FD-")))
`(let ((,fd (create ,size)))
(unwind-protect (let ((,fdvar ,fd)) ,@body)
- (unistd:close ,fd)))))
+ (unistd:close ,fd)))))
(defcunion epoll-data
(ptr :pointer)
@@ -54,13 +54,13 @@
(setf (foreign-slot-value evt '(:struct epoll-event) 'events) events)
(let ((data (foreign-slot-value evt '(:struct epoll-event) 'data)))
(with-foreign-slots ((ptr fd u32 u64) data (:union epoll-data))
- (cond (data-ptr (setf ptr data-ptr))
- (data-fd (setf fd data-fd))
- (data-u32 (setf u32 data-u32))
- (data-u64 (setf u64 data-u64)))))
+ (cond (data-ptr (setf ptr data-ptr))
+ (data-fd (setf fd data-fd))
+ (data-u32 (setf u32 data-u32))
+ (data-u64 (setf u64 data-u64)))))
(let ((r (c-epoll-ctl epfd op fd evt)))
(when (< r 0)
- (error-errno "epoll_ctl"))
+ (error-errno "epoll_ctl"))
r)))
(defun add (epfd fd events &key data-ptr data-fd data-u32 data-u64)
@@ -87,22 +87,22 @@
(timeout :int))
(defmacro wait ((events-var fd-var epfd &optional
- (maxevents 1024)
- (timeout -1))
- &body body)
+ (maxevents 1024)
+ (timeout -1))
+ &body body)
(let ((events (gensym "EVENTS-"))
- (e (gensym "E-"))
- (e-data (gensym "E-DATA-"))
- (i (gensym "I-"))
- (m (gensym "M-")))
+ (e (gensym "E-"))
+ (e-data (gensym "E-DATA-"))
+ (i (gensym "I-"))
+ (m (gensym "M-")))
`(let ((,m ,maxevents))
(with-foreign-object (,events '(:struct epoll-event) ,m)
- (let ((,i (c-epoll-wait ,epfd ,events ,m ,timeout)))
- (when (< ,i 0)
- (error-errno "epoll_wait"))
- (dotimes (,i ,i)
- (let* ((,e (mem-aref ,events '(:struct epoll-event) ,i))
- (,events-var (foreign-slot-value ,e '(:struct epoll-event) 'events))
- (,e-data (foreign-slot-value ,e '(:struct epoll-event) 'data))
- (,fd-var (foreign-slot-value ,e-data '(:union epoll-data) 'fd)))
- ,@body)))))))
+ (let ((,i (c-epoll-wait ,epfd ,events ,m ,timeout)))
+ (when (< ,i 0)
+ (error-errno "epoll_wait"))
+ (dotimes (,i ,i)
+ (let* ((,e (mem-aref ,events '(:struct epoll-event) ,i))
+ (,events-var (foreign-slot-value ,e '(:struct epoll-event) 'events))
+ (,e-data (foreign-slot-value ,e '(:struct epoll-event) 'data))
+ (,fd-var (foreign-slot-value ,e-data '(:union epoll-data) 'fd)))
+ ,@body)))))))