Make sure always to close the mpcl socket stream properly.
[lisp-utils.git] / mpcl.lisp
index 98a545e..de3e410 100644 (file)
--- a/mpcl.lisp
+++ b/mpcl.lisp
   "Disconnect from MPD."
   (with-conn-lock
     (let ((sk (prog1 *socket* (setf *socket* nil))))
-      (if sk (ignore-errors (close sk))))))
+      (when sk (handler-case
+                  (close sk)
+                (error () (close sk :abort t)))))))
 
 (defun connection-error (condition-type &rest condition-args)
   (disconnect)