]> git.eshelyaron.com Git - emacs.git/commitdiff
(gnus-inews-date): Avoid race condition.
authorKarl Heuer <kwzh@gnu.org>
Tue, 28 May 1996 15:43:27 +0000 (15:43 +0000)
committerKarl Heuer <kwzh@gnu.org>
Tue, 28 May 1996 15:43:27 +0000 (15:43 +0000)
lisp/gnus-msg.el

index 6756b9e1c52e0778dffe213a541e355a13f1371d..099b5e1ebeb686387139881e1a9601f6030a0014 100644 (file)
@@ -1383,8 +1383,12 @@ domain is undefined, the domain name is got from it."
 
 (defun gnus-inews-date ()
   "Current time string."
-  (timezone-make-date-arpa-standard 
-   (current-time-string) (current-time-zone)))
+  ;; 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)))
+    (timezone-make-date-arpa-standard 
+     (current-time-string now) (current-time-zone now))))
 
 (defun gnus-inews-organization ()
   "Return user's organization.