call-with-file-lock: fix port leak on error escape

This commit is contained in:
Matthew Flatt 2013-11-06 08:16:29 -07:00
parent 362b1eb1be
commit 02bbccc200

View File

@ -357,7 +357,7 @@
(with-handlers ([exn:fail:filesystem:exists? (lambda (exn) 'ok)])
(close-output-port (open-output-file lock-file #:exists 'error))))
(((if (eq? kind 'exclusive)
(lambda (fn proc) (call-with-output-file fn proc #:exists 'update))
(lambda (fn proc) (call-with-output-file* fn proc #:exists 'update))
call-with-input-file*)
lock-file
(lambda (p)