summaryrefslogtreecommitdiffstats
path: root/timezone.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:28 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:28 -0800
commitbd9733926076885e3417b74de76e4c9c7bc56254 (patch)
tree2c99dced547d48407ad44cb0e45e31bb4d02ce43 /timezone.scm
parentfa3f23105ddcf07c5900de47f19af43d1db1b597 (diff)
downloadslib-bd9733926076885e3417b74de76e4c9c7bc56254.tar.gz
slib-bd9733926076885e3417b74de76e4c9c7bc56254.zip
Import Upstream version 2c7upstream/2c7
Diffstat (limited to 'timezone.scm')
-rw-r--r--timezone.scm13
1 files changed, 8 insertions, 5 deletions
diff --git a/timezone.scm b/timezone.scm
index 2890c39..a9149e3 100644
--- a/timezone.scm
+++ b/timezone.scm
@@ -19,14 +19,14 @@
;; The C-library support for time in general and time-zones in particular
;; stands as a fine example of how *not* to create interfaces.
-;;
+;;
;; Functions are not consistently named. Support for GMT is offered in one
;; direction only; The localtime function returns some timezone data in the
;; structure which it returns, and some data in shared global variables.
;; The structure which localtime returns is overwritten with each
;; invocation. There is no way to find local time in zones other than GMT
;; and the local timezone.
-;;
+;;
;; The tzfile(5) format encodes only a single timezone per file. There is
;; no dispatch on zone names, so multiple copies of a timezone file exist
;; under different names. The TZ `:' specification is unix filesystem
@@ -35,14 +35,14 @@
;; ASCII bytes, it is incompatible with different character sizes. The
;; binary format makes it impossible to easily inspect a file for
;; corruption.
-;;
+;;
;; I have corrected most of the failings of the C-library time interface in
;; SLIB while maintaining compatablility. I wrote support for Linux
;; timezone files because on a system where TZ is not set, there is no
;; other way to reveal this information. HP-UX appears to have a more
;; sensible arrangement; I invite you to add support for it and other
;; platforms.
-;;
+;;
;; Writing this was a long, tedious, and unenlightening process. I hope it
;; is useful.
;;
@@ -60,7 +60,10 @@
;;; This definition is here so that READ-TZFILE can verify the
;;; existence of these files before loading tzfile.scm to actually
;;; read them.
-(define tzfile:vicinity (make-vicinity "/usr/lib/zoneinfo/"))
+(define tzfile:vicinity (make-vicinity
+ (if (file-exists? "/usr/share/zoneinfo/.")
+ "/usr/share/zoneinfo/"
+ "/usr/lib/zoneinfo/")))
(define (read-tzfile path)
(let ((realpath