diff options
| author | Richard M. Stallman | 1996-02-28 23:25:27 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-02-28 23:25:27 +0000 |
| commit | 22cc077c309591b393e23b8033ffb3f134b59e69 (patch) | |
| tree | e065ba8afec319aba5ce00ac3e1c5dc40f55a05b | |
| parent | 037987b711819ef71b6188e1a8e44190d3731329 (diff) | |
| download | emacs-22cc077c309591b393e23b8033ffb3f134b59e69.tar.gz emacs-22cc077c309591b393e23b8033ffb3f134b59e69.zip | |
(LOCALTIME_CACHE): Also define if localtime mishandles unsetting TZ.
This works around a localtime bug in mips-dec-ultrix.
| -rw-r--r-- | configure.in | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/configure.in b/configure.in index da8b2efc794..a977091e79f 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -3,7 +3,7 @@ dnl To rebuild the `configure' script from this, execute the command | |||
| 3 | dnl autoconf | 3 | dnl autoconf |
| 4 | dnl in the directory containing this script. | 4 | dnl in the directory containing this script. |
| 5 | dnl | 5 | dnl |
| 6 | dnl Copyright (C) 1994, 1995 Free Software Foundation, Inc. | 6 | dnl Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. |
| 7 | dnl | 7 | dnl |
| 8 | dnl This file is part of GNU Emacs. | 8 | dnl This file is part of GNU Emacs. |
| 9 | dnl | 9 | dnl |
| @@ -1375,16 +1375,31 @@ AC_TRY_RUN([#include <time.h> | |||
| 1375 | #if STDC_HEADERS | 1375 | #if STDC_HEADERS |
| 1376 | # include <stdlib.h> | 1376 | # include <stdlib.h> |
| 1377 | #endif | 1377 | #endif |
| 1378 | extern char **environ; | ||
| 1379 | unset_TZ () | ||
| 1380 | { | ||
| 1381 | char **from, **to; | ||
| 1382 | for (to = from = environ; (*to = *from); from++) | ||
| 1383 | if (! (to[0][0] == 'T' && to[0][1] == 'Z' && to[0][2] == '=')) | ||
| 1384 | to++; | ||
| 1385 | } | ||
| 1378 | main() | 1386 | main() |
| 1379 | { | 1387 | { |
| 1380 | time_t now = time ((time_t *) 0); | 1388 | time_t now = time ((time_t *) 0); |
| 1381 | int hour; | 1389 | int hour_GMT0, hour_unset; |
| 1382 | if (putenv ("TZ=GMT0") != 0) | 1390 | if (putenv ("TZ=GMT0") != 0) |
| 1383 | exit (1); | 1391 | exit (1); |
| 1384 | hour = localtime (&now)->tm_hour; | 1392 | hour_GMT0 = localtime (&now)->tm_hour; |
| 1393 | unset_TZ (); | ||
| 1394 | hour_unset = localtime (&now)->tm_hour; | ||
| 1385 | if (putenv ("TZ=PST8") != 0) | 1395 | if (putenv ("TZ=PST8") != 0) |
| 1386 | exit (1); | 1396 | exit (1); |
| 1387 | exit (localtime (&now)->tm_hour == hour); | 1397 | if (localtime (&now)->tm_hour == hour_GMT0) |
| 1398 | exit (1); | ||
| 1399 | unset_TZ (); | ||
| 1400 | if (localtime (&now)->tm_hour != hour_unset) | ||
| 1401 | exit (1); | ||
| 1402 | exit (0); | ||
| 1388 | }], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes, | 1403 | }], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes, |
| 1389 | [# If we have tzset, assume the worst when cross-compiling. | 1404 | [# If we have tzset, assume the worst when cross-compiling. |
| 1390 | emacs_cv_localtime_cache=yes]) | 1405 | emacs_cv_localtime_cache=yes]) |