From 9fe43ff672d02d6f43bd5bc7b08f40823c7a1851 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 18 Jan 2013 20:44:34 -0800 Subject: Work around bug in CIFS and vboxsf file systems. The bug was observed on Ubuntu operating inside a virtual machine, editing files mounted via CIFS or vboxsf from the MS Windows 7 host. The workaround introduces a race condition on non-buggy hosts, but it's an unlikely race and anyway there's a nearly identical nearby race that can't be fixed. * fileio.c (valid_timestamp_file_system, timestamp_file_system): New static vars. (Fwrite_region): Test for file system time stamp bug. (init_fileio): New function. * lisp.h (init_fileio): Declare it. * emacs.c (main): Call it. Fixes: debbugs:13149 --- src/emacs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/emacs.c') diff --git a/src/emacs.c b/src/emacs.c index 91a7ce6390d..6536c3708af 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1317,6 +1317,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem } init_callproc (); /* Must follow init_cmdargs but not init_sys_modes. */ + init_fileio (); init_lread (); #ifdef WINDOWSNT /* Check to see if Emacs has been installed correctly. */ -- cgit v1.2.1 From 73c1421878b3ce4ac6fdb2b0133fda7522578a29 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 19 Jan 2013 16:49:17 +0800 Subject: * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid aborting on Fsignal. Fixes: debbugs:13289 --- src/emacs.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/emacs.c') diff --git a/src/emacs.c b/src/emacs.c index 6536c3708af..b7888d343f1 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -133,7 +133,7 @@ Lisp_Object Qfile_name_handler_alist; Lisp_Object Qrisky_local_variable; -Lisp_Object Qkill_emacs; +Lisp_Object Qkill_emacs, Qkill_emacs_hook; /* If true, Emacs should not attempt to use a window-specific code, but instead should use the virtual terminal under which it was started. */ @@ -1841,7 +1841,6 @@ all of which are called before Emacs is actually killed. */) (Lisp_Object arg) { struct gcpro gcpro1; - Lisp_Object hook; int exit_code; GCPRO1 (arg); @@ -1849,9 +1848,10 @@ all of which are called before Emacs is actually killed. */) if (feof (stdin)) arg = Qt; - hook = intern ("kill-emacs-hook"); - Frun_hooks (1, &hook); - + /* Fsignal calls emacs_abort () if it sees that waiting_for_input is + set. */ + waiting_for_input = 0; + Frun_hooks (1, &Qkill_emacs_hook); UNGCPRO; #ifdef HAVE_X_WINDOWS @@ -2263,6 +2263,7 @@ syms_of_emacs (void) DEFSYM (Qfile_name_handler_alist, "file-name-handler-alist"); DEFSYM (Qrisky_local_variable, "risky-local-variable"); DEFSYM (Qkill_emacs, "kill-emacs"); + DEFSYM (Qkill_emacs_hook, "kill-emacs-hook"); #ifndef CANNOT_DUMP defsubr (&Sdump_emacs); -- cgit v1.2.1 From 593a5f2efdac581be0964c0eb8583dde2b661173 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 21 Jan 2013 23:48:59 -0800 Subject: * emacs.c (Qkill_emacs_hook): Now static. --- src/emacs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/emacs.c') diff --git a/src/emacs.c b/src/emacs.c index b7888d343f1..597fb2daf95 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -133,7 +133,8 @@ Lisp_Object Qfile_name_handler_alist; Lisp_Object Qrisky_local_variable; -Lisp_Object Qkill_emacs, Qkill_emacs_hook; +Lisp_Object Qkill_emacs; +static Lisp_Object Qkill_emacs_hook; /* If true, Emacs should not attempt to use a window-specific code, but instead should use the virtual terminal under which it was started. */ -- cgit v1.2.1 From e7ac588e198385a9bc5a2338000ab6db69c2353c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 2 Feb 2013 19:14:24 +0200 Subject: Avoid encoding file names run through dostounix_filename on MS-Windows. src/w32.c (normalize_filename): Accept an additional argument MULTIBYTE; if non-zero, traverse the file name by bytes and don't downcase it even if w32-downcase-file-names is non-nil. (dostounix_filename): Accept an additional argument MULTIBYTE and pass it to normalize_filename. (emacs_root_dir): Adjust. src/msdos.h (dostounix_filename): Adjust prototype. src/w32.h (dostounix_filename): Adjust prototype. src/msdos.c (dostounix_filename): Accept an additional argument and ignore it. (init_environment): Adjust callers of dostounix_filename. src/fileio.c (Ffile_name_directory, file_name_as_directory) (directory_file_name, Fexpand_file_name) (Fsubstitute_in_file_name): [DOS_NT] Adjust call to dostounix_filename. [WINDOWSNT]: Downcase file names if w32-downcase-file-names is non-nil. (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment variables, as egetenv is case-insensitive for DOS_NT. src/dired.c (file_name_completion): Don't call Fdirectory_file_name with an encoded file name. src/w32proc.c (Fw32_short_file_name, Fw32_long_file_name): Adjust calls to dostounix_filename. src/w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename. src/unexw32.c (unexec): Adjust call to dostounix_filename. src/termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename. src/emacs.c (decode_env_path) [DOS_NT]: Adjust call to dostounix_filename. src/callproc.c (Fcall_process) [MSDOS]: Adjust call to dostounix_filename. --- src/emacs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/emacs.c') diff --git a/src/emacs.c b/src/emacs.c index 597fb2daf95..c351b1e9b9e 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2152,7 +2152,7 @@ decode_env_path (const char *evarname, const char *defalt) { char *path_copy = alloca (strlen (path) + 1); strcpy (path_copy, path); - dostounix_filename (path_copy); + dostounix_filename (path_copy, 0); path = path_copy; } #endif -- cgit v1.2.1 From 5257b7014c4d7fe3b48a75122746d4ec48a6c42c Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Sun, 3 Feb 2013 08:45:37 -0800 Subject: * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that daemon mode works on cygw32 when Emacs is installed and not just during development. --- src/emacs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/emacs.c') diff --git a/src/emacs.c b/src/emacs.c index c351b1e9b9e..c494dff8cac 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1059,7 +1059,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem argv[skip_args] = fdStr; - execv (argv[0], argv); + execvp (argv[0], argv); fprintf (stderr, "emacs daemon: exec failed: %d\n", errno); exit (1); } -- cgit v1.2.1 From 1ddc2bd6ff0b5071454d2591f835927ea5b85a06 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 24 Feb 2013 21:55:37 -0800 Subject: Simplify data_start configuration. This is a followon simplification to the fix for Bug#13650. * admin/CPP-DEFINES (DATA_START, ORDINARY_LINK): Remove. * configure.ac (CRT_DIR, LIB_STANDARD, START_FILES, DATA_START) (LD_FIRSTFLAG, ORDINARY_LINK, LIB_GCC): Remove. (AC_CHECK_HEADERS_ONCE): Remove sys/resource.h, as it's not always needed. (HAVE_DATA_START): New macro. * etc/PROBLEMS (LIBS_SYSTEM, LIBS_MACHINE, LIBS_STANDARD): Remove. Remove legacy-systems section, as this stuff is no longer applicable with current linking strategies. * src/Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD) (START_FILES): Remove. All uses removed. (otherobj): Remove $(VMLIMIT_OBJ), as it's now first. (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first. (buildobj.h): Use it. ($(ALLOBJS)): Depend on globals.h. (temacs$(EXEEXT)): Use $(ALLOBJS). * src/autodeps.mk (ALLOBJS): Move to Makefile.in. * src/deps.mk (vm-limit.o): * src/makefile.w32-in ($(BLD)/vm-limit.$(O)): Do not depend on mem-limits.h. * src/emacs.c (__do_global_ctors, __do_global_ctors_aux) (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__) [__GNUC__ && !ORDINARY_LINK]: Remove. * src/mem-limits.h, src/pre-crt0.c: Remove. * src/unexaix.c, src/unexcoff.c: Don't include mem-limits.h. * src/unexcoff.c (etext): New decl. (make_hdr): Use it instead of start_of_data. * src/vm-limit.c: Move most of mem-limits.h's contents here. (data_start): New decl. It's OK if this is approximate, so simplify-away some unnecessary exactness. (POINTER): Remove; all uses removed. (data_space_start): Now char *, to avoid casts. (exceeds_lisp_ptr): New function, replacing the old EXCEEDS_LISP_PTR macro. All uses changed. (check_memory_limits): Simplify and remove casts. (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove. (memory_warnings): Use data_start instead of start_of_data. Fixes: debbugs:13783 --- src/emacs.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'src/emacs.c') diff --git a/src/emacs.c b/src/emacs.c index c494dff8cac..b96076b1340 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -521,32 +521,6 @@ DEFUN ("invocation-directory", Finvocation_directory, Sinvocation_directory, static char const dump_tz[] = "UtC0"; #endif -#ifndef ORDINARY_LINK -/* We don't include crtbegin.o and crtend.o in the link, - so these functions and variables might be missed. - Provide dummy definitions to avoid error. - (We don't have any real constructors or destructors.) */ -#ifdef __GNUC__ - -/* Define a dummy function F. Declare F too, to pacify gcc - -Wmissing-prototypes. */ -#define DEFINE_DUMMY_FUNCTION(f) \ - void f (void) ATTRIBUTE_CONST EXTERNALLY_VISIBLE; void f (void) {} - -#ifndef GCC_CTORS_IN_LIBC -DEFINE_DUMMY_FUNCTION (__do_global_ctors) -DEFINE_DUMMY_FUNCTION (__do_global_ctors_aux) -DEFINE_DUMMY_FUNCTION (__do_global_dtors) -/* GNU/Linux has a bug in its library; avoid an error. */ -#ifndef GNU_LINUX -char * __CTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 }; -#endif -char * __DTOR_LIST__[2] EXTERNALLY_VISIBLE = { (char *) (-1), 0 }; -#endif /* GCC_CTORS_IN_LIBC */ -DEFINE_DUMMY_FUNCTION (__main) -#endif /* __GNUC__ */ -#endif /* ORDINARY_LINK */ - /* Test whether the next argument in ARGV matches SSTR or a prefix of LSTR (at least MINLEN characters). If so, then if VALPTR is non-null (the argument is supposed to have a value) store in *VALPTR either -- cgit v1.2.1