diff --git a/cffi-socket.lisp b/cffi-socket.lisp
index bc278dc..108b432 100644
--- a/cffi-socket.lisp
+++ b/cffi-socket.lisp
@@ -32,7 +32,7 @@
s))
(defun socket-close (fd)
- (unless (= -1 (unistd:c-dup2 fd fd))
+ (unless (< (the fixnum (unistd:c-dup2 fd fd)) 0)
(shutdown fd)
(unistd:close fd)))