Avoid a race condition with the GC daemon in LOOKUP-UNCOMPRESSED-FILE.
authorTaylor R. Campbell <net/mumble/campbell>
Sun, 10 Feb 2008 21:35:46 +0000 (21:35 +0000)
committerTaylor R. Campbell <net/mumble/campbell>
Sun, 10 Feb 2008 21:35:46 +0000 (21:35 +0000)
v7/src/runtime/infutl.scm

index 5f8e6d461fbc0288669d1b59c59ed11a9e94b9d8..d25acb8bdeb422fe1f250b475541e840c09f23fb 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: infutl.scm,v 1.74 2008/01/30 20:02:31 cph Exp $
+$Id: infutl.scm,v 1.75 2008/02/10 21:35:46 riastradh Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -752,11 +752,14 @@ USA.
        (cond ((null? entries)
              (if-not-found))
             ((and (pathname=? (caar entries) compressed-file)
-                  (cddar entries)
-                  (or (file-exists? (cadar entries))
-                      (begin
-                        (set-cdr! (cdar entries) #f)
-                        #f)))
+                  ;; Avoid a subtle race condition with the GC daemon.
+                  (let ((time (cddar entries)))
+                    (set-cdr! (cdar entries) (real-time-clock))
+                    (and time
+                         (or (file-exists? (cadar entries))
+                             (begin
+                               (set-cdr! (cdar entries) #f)
+                               #f)))))
              (dynamic-wind
               (lambda () unspecific)
               (lambda ()