summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1996-05-28 15:43:27 +0000
committerKarl Heuer <kwzh@gnu.org>1996-05-28 15:43:27 +0000
commitab429dbd3c077a4b27fa581b1509986749411602 (patch)
treea91e48aea689915ff042ecbd41c52245c2113a17 /lisp
parent96d50ecc6fd0c53f986ce4309b0383c34f1a44e7 (diff)
downloademacs-ab429dbd3c077a4b27fa581b1509986749411602.tar.gz
(gnus-inews-date): Avoid race condition.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/gnus-msg.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el
index 6756b9e1c52..099b5e1ebeb 100644
--- a/lisp/gnus-msg.el
+++ b/lisp/gnus-msg.el
@@ -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.