From 6db29a5adb603c7a50a7cd42d7de9a5fa2964a71 Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Mon, 31 Dec 2007 03:02:13 +0100 Subject: [PATCH] Fix CLOSE method on MY-FILE-STREAM in the stream test suite. Signed-off-by: Stelian Ionescu --- tests/streams.lisp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/streams.lisp b/tests/streams.lisp index 786c043..2a45988 100644 --- a/tests/streams.lisp +++ b/tests/streams.lisp @@ -34,9 +34,12 @@ (defclass my-file-stream (dual-channel-single-fd-gray-stream) ((path :initarg :path :reader file-stream-path))) -(defmethod close :after ((file my-file-stream) &key abort) +(defmethod close :around ((file my-file-stream) &key abort) (declare (ignore abort)) - (nix:close (fd-of file))) + (call-next-method) + (when (fd-of file) + (nix:close (fd-of file))) + (setf (fd-of file) nil)) ;;; Very ad-hoc: doesn't do :DIRECTION :PROBE, or handle errors, ;;; :IF-DOES-NOT-EXIST, among many other things. This kind of thing -- 2.11.4.GIT