aboutsummaryrefslogtreecommitdiffstats
path: root/src/emacs.c
diff options
context:
space:
mode:
authorPaul Eggert2013-06-23 11:18:47 -0700
committerPaul Eggert2013-06-23 11:18:47 -0700
commitc7041908b82205af2f812f9de782003d975f53da (patch)
tree6d0d071cc0cd36cf172a18b92e5b1f41c3299b80 /src/emacs.c
parent18bb9e21f3a95114d34947283e76a973692b526c (diff)
downloademacs-c7041908b82205af2f812f9de782003d975f53da.tar.gz
emacs-c7041908b82205af2f812f9de782003d975f53da.zip
Try to avoid malloc SEGVs on Cygwin.
* callproc.c, process.h (block_child_signal, unblock_child_signal): Now extern. * emacs.c (main): Catch SIGCHLD just before initializing gfilenotify. * process.c (catch_child_signal): Block SIGCHLD while futzing with the SIGCHLD handler, since the code is not atomic and (due to glib) signals may be arriving now. * sysdep.c (init_signals): Do not catch child signals here; 'main' now does that later, at a safer time. Fixes: debbugs:14569
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 13f6d117ebc..c5b32c7c0e7 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1257,6 +1257,13 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1257 tzset (); 1257 tzset ();
1258#endif /* MSDOS */ 1258#endif /* MSDOS */
1259 1259
1260 /* Do this after initializing the memory allocator, since it uses
1261 glib and glib uses malloc. And do it before anything else that
1262 invokes glib, to avoid potential races among glib subthreads in
1263 Cygwin glib. gfilenotify invokes glib, so this can't be delayed
1264 further. */
1265 catch_child_signal ();
1266
1260#ifdef HAVE_GFILENOTIFY 1267#ifdef HAVE_GFILENOTIFY
1261 globals_of_gfilenotify (); 1268 globals_of_gfilenotify ();
1262#endif 1269#endif