Commit 3fdc8935419f33c6d0dcc66601a15d6c6b808db2

Thomas de Grivel 2017-05-27T21:41:59

Fix close.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/cffi-unistd.lisp b/cffi-unistd.lisp
index 9055742..1b0b421 100644
--- a/cffi-unistd.lisp
+++ b/cffi-unistd.lisp
@@ -5,8 +5,10 @@
   (fd :int))
 
 (defun close (fd)
-  (when (< (c-close fd) 0)
-    (error-errno "close")))
+  (let ((r (c-close fd)))
+    (when (< r 0)
+      (error-errno "close"))
+    r))
 
 (defcfun ("read" c-read) ssize-t
   (fd :int)