From: David L. <lic...@us...> - 2011-08-10 18:26:59
|
The branch "master" has been updated in SBCL: via 9b729ff750ac2b002c1e391ef441163bec7b4295 (commit) from f179b4c117ffc1886cf106c053b248ad3f88a968 (commit) - Log ----------------------------------------------------------------- commit 9b729ff750ac2b002c1e391ef441163bec7b4295 Author: David Lichteblau <da...@li...> Date: Wed Aug 10 16:50:29 2011 +0200 sb-simple-streams: Close files before deleting them on revert Thanks to Anton Kovalenko. --- contrib/sb-simple-streams/file.lisp | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/sb-simple-streams/file.lisp b/contrib/sb-simple-streams/file.lisp index e668269..48d48ad 100644 --- a/contrib/sb-simple-streams/file.lisp +++ b/contrib/sb-simple-streams/file.lisp @@ -152,15 +152,18 @@ (defmethod device-close ((stream file-simple-stream) abort) (with-stream-class (file-simple-stream stream) - (let ((fd (or (sm input-handle stream) (sm output-handle stream)))) + (let ((fd (or (sm input-handle stream) (sm output-handle stream))) + (closed nil)) (when (sb-int:fixnump fd) (cond (abort (when (any-stream-instance-flags stream :output) + #+win32 (progn (sb-unix:unix-close fd) (setf closed t)) (revert-file (sm filename stream) (sm original stream)))) (t (when (sm delete-original stream) (delete-original (sm filename stream) (sm original stream))))) - (sb-unix:unix-close fd)) + (unless closed + (sb-unix:unix-close fd))) (when (sm buffer stream) (free-buffer (sm buffer stream)) (setf (sm buffer stream) nil)))) ----------------------------------------------------------------------- hooks/post-receive -- SBCL |