diff options
| author | Richard M. Stallman | 1996-01-17 18:03:03 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-01-17 18:03:03 +0000 |
| commit | 0269dedb5c9a11f27214f60dddf3cf99031615b4 (patch) | |
| tree | 3688231e8a650e53d4568267d5481c9fb38311a9 /src | |
| parent | a92ae0ce7b3a9d01246e1c06ecabb680bdd5fa54 (diff) | |
| download | emacs-0269dedb5c9a11f27214f60dddf3cf99031615b4.tar.gz emacs-0269dedb5c9a11f27214f60dddf3cf99031615b4.zip | |
(Fdump_emacs): If HAVE_TZSET and not
LOCALTIME_CACHE, call tzset to force a tz reload.
(set_time_zone_rule): New decl.
(dump_tz): New var.
(main): Change TZ twice if the execution TZ happens to be the same as
the dump TZ.
(Fdump_emacs): Set TZ to unlikely value just before dumping.
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/emacs.c b/src/emacs.c index b18e3d5dc5f..90c66cd6cbe 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -48,6 +48,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 48 | #endif | 48 | #endif |
| 49 | 49 | ||
| 50 | extern void malloc_warning (); | 50 | extern void malloc_warning (); |
| 51 | extern void set_time_zone_rule (); | ||
| 51 | extern char *index (); | 52 | extern char *index (); |
| 52 | extern char *strerror (); | 53 | extern char *strerror (); |
| 53 | 54 | ||
| @@ -315,6 +316,12 @@ extern noshare char **environ; | |||
| 315 | #endif /* LINK_CRTL_SHARE */ | 316 | #endif /* LINK_CRTL_SHARE */ |
| 316 | #endif /* VMS */ | 317 | #endif /* VMS */ |
| 317 | 318 | ||
| 319 | #ifdef HAVE_TZSET | ||
| 320 | /* A valid but unlikely value for the TZ environment value. | ||
| 321 | It is OK (though a bit slower) if the user actually chooses this value. */ | ||
| 322 | static char dump_tz[] = "UtC0"; | ||
| 323 | #endif | ||
| 324 | |||
| 318 | #ifndef ORDINARY_LINK | 325 | #ifndef ORDINARY_LINK |
| 319 | /* We don't include crtbegin.o and crtend.o in the link, | 326 | /* We don't include crtbegin.o and crtend.o in the link, |
| 320 | so these functions and variables might be missed. | 327 | so these functions and variables might be missed. |
| @@ -940,6 +947,23 @@ Usage: %s [-t term] [--terminal term] [-nw] [--no-windows] [--batch]\n\ | |||
| 940 | XSETFASTINT (Vmessage_log_max, 0); | 947 | XSETFASTINT (Vmessage_log_max, 0); |
| 941 | message_dolog ("", 0, 1); | 948 | message_dolog ("", 0, 1); |
| 942 | Vmessage_log_max = old_log_max; | 949 | Vmessage_log_max = old_log_max; |
| 950 | |||
| 951 | #ifdef HAVE_TZSET | ||
| 952 | { | ||
| 953 | /* If the execution TZ happens to be the same as the dump TZ, | ||
| 954 | change it to some other value and then change it back, | ||
| 955 | to force the underlying implementation to reload the TZ info. | ||
| 956 | This is needed on implementations that load TZ info from files, | ||
| 957 | since the TZ file contents may differ between dump and execution. */ | ||
| 958 | char *tz = getenv ("TZ"); | ||
| 959 | if (tz && !strcmp (tz, dump_tz)) | ||
| 960 | { | ||
| 961 | ++*tz; | ||
| 962 | tzset (); | ||
| 963 | --*tz; | ||
| 964 | } | ||
| 965 | } | ||
| 966 | #endif | ||
| 943 | } | 967 | } |
| 944 | 968 | ||
| 945 | initialized = 1; | 969 | initialized = 1; |
| @@ -1329,6 +1353,14 @@ and announce itself normally when it is run.") | |||
| 1329 | tem = Vpurify_flag; | 1353 | tem = Vpurify_flag; |
| 1330 | Vpurify_flag = Qnil; | 1354 | Vpurify_flag = Qnil; |
| 1331 | 1355 | ||
| 1356 | #ifdef HAVE_TZSET | ||
| 1357 | set_time_zone_rule (dump_tz); | ||
| 1358 | #ifndef LOCALTIME_CACHE | ||
| 1359 | /* Force a tz reload, since set_time_zone_rule doesn't. */ | ||
| 1360 | tzset (); | ||
| 1361 | #endif | ||
| 1362 | #endif | ||
| 1363 | |||
| 1332 | fflush (stdout); | 1364 | fflush (stdout); |
| 1333 | #ifdef VMS | 1365 | #ifdef VMS |
| 1334 | mapout_data (XSTRING (filename)->data); | 1366 | mapout_data (XSTRING (filename)->data); |