summaryrefslogtreecommitdiff
path: root/lisp/org/org-clock.el
diff options
context:
space:
mode:
authorCharles A. Roelli <charles@aurox.ch>2017-09-30 20:42:03 +0200
committerCharles A. Roelli <charles@aurox.ch>2017-10-01 19:07:22 +0200
commitbd49b6f1b39cffeaf6098bc7b0182552683b1c07 (patch)
tree8d9f63ebf2b9342142c38157f610e47573f0e630 /lisp/org/org-clock.el
parent913808e224455dc3cd3d7ea0ff5d36849319954a (diff)
downloademacs-bd49b6f1b39cffeaf6098bc7b0182552683b1c07.tar.gz
Workaround for faulty localtime() under macOS 10.6
* lisp/org/org-clock.el (org-clock--oldest-date): Only execute 'decode-time' on times later than year -2**31 under macOS 10.6. See Bug#27706.
Diffstat (limited to 'lisp/org/org-clock.el')
-rw-r--r--lisp/org/org-clock.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 8df185d2e91..2eec817735a 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -478,7 +478,17 @@ to add an effort property.")
(funcall dichotomy
most-negative-fixnum
0
- (lambda (m) (ignore-errors (decode-time (list m 0))))))
+ (lambda (m)
+ ;; libc in macOS 10.6 hangs when decoding times
+ ;; around year -2**31. Limit `high' not to go
+ ;; any earlier than that.
+ (unless (and (eq system-type 'darwin)
+ (string-match-p
+ "10\\.6\\.[[:digit:]]"
+ (shell-command-to-string
+ "sw_vers -productVersion"))
+ (<= m -1034058203136))
+ (ignore-errors (decode-time (list m 0)))))))
(low
(funcall dichotomy
most-negative-fixnum