From 9dac2e4b9edad56b6d88d6a4981086d691ad0304 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 4 Aug 1989 02:14:09 +0000 Subject: [PATCH] Use new primitive `directory-close' to guarantee that the directory-reader is correctly cleaned up when aborted. --- v7/src/runtime/unxdir.scm | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/v7/src/runtime/unxdir.scm b/v7/src/runtime/unxdir.scm index d5c3165ea..0ab544065 100644 --- a/v7/src/runtime/unxdir.scm +++ b/v7/src/runtime/unxdir.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/unxdir.scm,v 14.3 1988/10/21 22:21:28 cph Rel $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/unxdir.scm,v 14.4 1989/08/04 02:14:09 cph Rel $ Copyright (c) 1988 Massachusetts Institute of Technology @@ -72,14 +72,20 @@ MIT in each case. |# (pathname-type instance)))))))))))) (define (generate-directory-pathnames pathname) - (let loop - ((name ((ucode-primitive open-directory) (pathname->string pathname))) - (result '())) - (if name - (loop ((ucode-primitive directory-read)) - (cons (merge-pathnames pathname (string->pathname name)) - result)) - (reverse! result)))) + (dynamic-wind + (lambda () unspecific) + (lambda () + (let loop + ((name + ((ucode-primitive open-directory 1) (pathname->string pathname))) + (result '())) + (if name + (loop ((ucode-primitive directory-read 0)) + (cons (merge-pathnames (string->pathname name) pathname) + result)) + result))) + (ucode-primitive directory-close 0))) + (define (extract-greatest-versions pathnames) (let ((name-alist '())) (for-each (lambda (pathname) -- 2.25.1