From: Karl Heuer Date: Tue, 28 May 1996 15:42:20 +0000 (+0000) Subject: * gnus.el (gnus-article-date-ut): Avoid race condition. X-Git-Tag: emacs-19.34~565 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f81911b650bd0d7859fcf2fb5d3c6c21aaf33a5f;p=emacs.git * gnus.el (gnus-article-date-ut): Avoid race condition. --- diff --git a/lisp/gnus.el b/lisp/gnus.el index 8086864db4a..74a6ed20a18 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -11287,12 +11287,16 @@ how much time has lapsed since DATE." ((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")))