1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-22 18:35:09 +00:00
emacs/m4
Paul Eggert 5745a7df2b Use putenv+unsetenv instead of modifying environ directly.
* admin/merge-gnulib (GNULIB_MODULES): Add putenv, unsetenv.
* lib/putenv.c, lib/unsetenv.c, m4/putenv.m4, m4/setenv.m4:
New files, copied automatically from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* src/alloc.c (xputenv): New function.
* src/dbusbind.c (Fdbus_init_bus):
* src/emacs.c (main):
* src/xterm.c (x_term_init):
Use xputenv instead of setenv or putenv, to detect memory exhaustion.
* src/editfns.c (initial_tz): Move static var decl up.
(tzvalbuf_in_environ): New static var.
(init_editfns):	Initialize these two static vars.
(Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
Save old TZ value on stack, if it's small.
(Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
instead, use xputenv+unsetenv to set and restore TZ.
(environbuf): Remove static var.  All uses removed.
(Fset_time_zone_rule): Do not save TZ and environ;
no longer needed here.
(set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
Move to inside set_time_zone_rule; they don't need file scope any more.
(set_time_zone_rule): Maintain the TZ=value string separately.
(syms_of_editfns): Don't initialize initial_tz;
init_editfns now does it.
* src/emacs.c (dump_tz) [HAVE_TZSET]: Now const.
* src/lisp.h (xputenv): New decl.

Fixes: debbugs:13070
2012-12-08 09:19:51 -08:00
..
00gnulib.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
alloca.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
c-strtod.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
clock_time.m4 Add gnulib files to support higher-resolution time stamps. 2012-06-22 14:26:37 -07:00
close-stream.m4 Fix data-loss with --batch. 2012-11-03 11:54:17 -07:00
dup2.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
environ.m4 Use Gnulib stdalign and environ modules (Bug#9772, Bug#9960). 2012-07-28 16:05:32 -07:00
euidaccess.m4 Use faccessat, not access, when checking file permissions. 2012-11-13 20:55:41 -08:00
execinfo.m4 * lib/execinfo.c, lib/execinfo.in.h, m4/execinfo.m4: New files. 2012-08-24 21:27:32 -07:00
extensions.m4 Merge from gnulib. 2012-06-22 10:20:00 -07:00
extern-inline.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
faccessat.m4 Use faccessat, not access, when checking file permissions. 2012-11-13 20:55:41 -08:00
fcntl_h.m4 Use faccessat, not access, when checking file permissions. 2012-11-13 20:55:41 -08:00
filemode.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
fpending.m4 Fix data-loss with --batch. 2012-11-03 11:54:17 -07:00
getgroups.m4 Use faccessat, not access, when checking file permissions. 2012-11-13 20:55:41 -08:00
getloadavg.m4 Remove "#define unix" that is no longer needed (Bug#11905). 2012-07-10 17:01:21 -07:00
getopt.m4 Remove "#define unix" that is no longer needed (Bug#11905). 2012-07-10 17:01:21 -07:00
gettime.m4 Add gnulib files to support higher-resolution time stamps. 2012-06-22 14:26:37 -07:00
gettimeofday.m4 Add gnulib files to support higher-resolution time stamps. 2012-06-22 14:26:37 -07:00
gnulib-common.m4 Merge from gnulib. 2012-06-22 10:20:00 -07:00
gnulib-comp.m4 Use putenv+unsetenv instead of modifying environ directly. 2012-12-08 09:19:51 -08:00
gnulib-tool.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
group-member.m4 Use faccessat, not access, when checking file permissions. 2012-11-13 20:55:41 -08:00
include_next.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
inttypes.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
largefile.m4 Merge from gnulib. 2012-06-22 10:20:00 -07:00
longlong.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
lstat.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
manywarnings.m4 Merge from gnulib. 2012-10-04 00:15:42 -07:00
md5.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
mktime.m4 Merge from gnulib. 2012-08-19 16:31:24 -07:00
multiarch.m4 Merge from gnulib. 2012-06-22 10:20:00 -07:00
nocrash.m4 Merge from gnulib. 2012-06-22 10:20:00 -07:00
off_t.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
pathmax.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
pselect.m4 Merge from gnulib. 2012-10-04 00:15:42 -07:00
pthread_sigmask.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
putenv.m4 Use putenv+unsetenv instead of modifying environ directly. 2012-12-08 09:19:51 -08:00
readlink.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
setenv.m4 Use putenv+unsetenv instead of modifying environ directly. 2012-12-08 09:19:51 -08:00
sha1.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
sha256.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
sha512.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
sig2str.m4 Assume POSIX 1003.1-1988 or later for signal.h. 2012-12-07 18:30:51 -08:00
signal_h.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
socklen.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
ssize_t.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
st_dm_mode.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
stat-time.m4 Merge from gnulib. 2012-08-19 16:31:24 -07:00
stat.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
stdalign.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
stdarg.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
stdbool.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
stddef_h.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
stdint.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
stdio_h.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
stdlib_h.m4 Merge from gnulib. 2012-10-04 00:15:42 -07:00
strftime.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
strtoimax.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
strtoll.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
strtoull.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
strtoumax.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
symlink.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
sys_select_h.m4 Add gnulib files to support higher-resolution time stamps. 2012-06-22 14:26:37 -07:00
sys_socket_h.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
sys_stat_h.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
sys_time_h.m4 Port to OpenBSD 5.1 amd64. 2012-07-06 03:08:57 +00:00
sys_types_h.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
time_h.m4 Merge from gnulib (comment-only change). 2012-06-25 07:49:15 -07:00
time_r.m4 Merge from gnulib. 2012-06-22 10:20:00 -07:00
timer_time.m4 Check more robustly for timer_settime. 2012-09-26 18:06:23 -07:00
timespec.m4 Merge from gnulib. 2012-08-19 16:31:24 -07:00
tm_gmtoff.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
unistd_h.m4 Merge from gnulib for 'inline'. 2012-11-30 10:25:59 -08:00
utimbuf.m4 Add gnulib files to support higher-resolution time stamps. 2012-06-22 14:26:37 -07:00
utimens.m4 Add gnulib files to support higher-resolution time stamps. 2012-06-22 14:26:37 -07:00
utimes.m4 Add gnulib files to support higher-resolution time stamps. 2012-06-22 14:26:37 -07:00
warnings.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00
wchar_t.m4 Merge from gnulib. 2012-05-26 16:14:36 -07:00