/* True if the MALLOC_CHECK_ environment variable was set while
dumping. Used to work around a bug in glibc's malloc. */
static bool malloc_using_checking;
+#elif defined HAVE_PTHREAD && !defined SYSTEM_MALLOC
+extern void malloc_enable_thread (void);
#endif
Lisp_Object Qfile_name_handler_alist;
static void *ns_pool;
#endif
+#if !HAVE_SETLOCALE
+static char *
+setlocale (int cat, char const *locale)
+{
+ return 0;
+}
+#endif
/* Report a fatal error due to signal SIG, output a backtrace of at
#endif /* DOS_NT */
}
-#if defined (HAVE_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
- if (! noninteractive)
- {
- extern void malloc_enable_thread (void);
-
- malloc_enable_thread ();
- }
+#if defined HAVE_PTHREAD && !defined SYSTEM_MALLOC && !defined DOUG_LEA_MALLOC
+# ifndef CANNOT_DUMP
+ /* Do not make gmalloc thread-safe when creating bootstrap-emacs, as
+ that causes an infinite recursive loop with FreeBSD. But do make
+ it thread-safe when creating emacs, otherwise bootstrap-emacs
+ fails on Cygwin. See Bug#14569. */
+ if (!noninteractive || initialized)
+# endif
+ malloc_enable_thread ();
#endif
init_signals (dumping);
noninteractive1 = noninteractive;
-/* Perform basic initializations (not merely interning symbols). */
+ /* Perform basic initializations (not merely interning symbols). */
if (!initialized)
{
init_coding_once ();
init_syntax_once (); /* Create standard syntax table. */
init_category_once (); /* Create standard category table. */
- /* Must be done before init_buffer. */
- init_casetab_once ();
+ init_casetab_once (); /* Must be done before init_buffer_once. */
init_buffer_once (); /* Create buffer table and some buffers. */
init_minibuf_once (); /* Create list of minibuffers. */
/* Must precede init_window_once. */
syms_of_fileio ();
/* Before syms_of_coding to initialize Vgc_cons_threshold. */
syms_of_alloc ();
+ /* May call Ffuncall and so GC, thus the latter should be initialized. */
+ init_print_once ();
/* Before syms_of_coding because it initializes Qcharsetp. */
syms_of_charset ();
/* Before init_window_once, because it sets up the
tzset ();
#endif /* MSDOS */
+#ifdef HAVE_GFILENOTIFY
+ globals_of_gfilenotify ();
+#endif
+
#ifdef WINDOWSNT
globals_of_w32 ();
+#ifdef HAVE_W32NOTIFY
globals_of_w32notify ();
+#endif
/* Initialize environment from registry settings. */
init_environment (argv);
init_ntproc (dumping); /* must precede init_editfns. */
syms_of_gnutls ();
#endif
+#ifdef HAVE_GFILENOTIFY
+ syms_of_gfilenotify ();
+#endif /* HAVE_GFILENOTIFY */
+
#ifdef HAVE_INOTIFY
syms_of_inotify ();
#endif /* HAVE_INOTIFY */
#ifdef WINDOWSNT
syms_of_ntterm ();
+#ifdef HAVE_W32NOTIFY
syms_of_w32notify ();
+#endif /* HAVE_W32NOTIFY */
#endif /* WINDOWSNT */
syms_of_profiler ();
kill it because we are exiting Emacs deliberately (not crashing).
Do it after shut_down_emacs, which does an auto-save. */
if (STRINGP (Vauto_save_list_file_name))
- unlink (SSDATA (Vauto_save_list_file_name));
+ {
+ Lisp_Object listfile;
+ listfile = Fexpand_file_name (Vauto_save_list_file_name, Qnil);
+ unlink (SSDATA (listfile));
+ }
if (INTEGERP (arg))
exit_code = (XINT (arg) < 0
error ("This function can only be called after loading the init files");
/* Get rid of stdin, stdout and stderr. */
- nfd = open ("/dev/null", O_RDWR);
+ nfd = emacs_open ("/dev/null", O_RDWR, 0);
err |= nfd < 0;
err |= dup2 (nfd, 0) < 0;
err |= dup2 (nfd, 1) < 0;