# HG changeset patch # User Karl Heuer # Date 833298140 0 # Node ID befefbf0670f1a9bcd56f0c773be9f5bc066feee # Parent b77f65304dd9518a0fac0547416d24290f997587 * gnus.el (gnus-article-date-ut): Avoid race condition. diff -r b77f65304dd9 -r befefbf0670f lisp/gnus.el --- a/lisp/gnus.el Tue May 28 15:22:05 1996 +0000 +++ b/lisp/gnus.el Tue May 28 15:42:20 1996 +0000 @@ -11287,12 +11287,16 @@ ((eq type 'lapsed) ;; If the date is seriously mangled, the timezone ;; functions are liable to bug out, so we condition-case - ;; the entire thing. - (let* ((real-sec (condition-case () + ;; the entire thing. We call (current-time) once, rather than + ;; letting current-time-string and current-time-zone default to + ;; it, because that avoids a rare race condition when the time + ;; zone changes between those two calls. + (let* ((now (current-time)) + (real-sec (condition-case () (- (gnus-seconds-since-epoch (timezone-make-date-arpa-standard - (current-time-string) - (current-time-zone) "UT")) + (current-time-string now) + (current-time-zone now) "UT")) (gnus-seconds-since-epoch (timezone-make-date-arpa-standard date nil "UT")))