aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorPhilipp Stephani2021-01-10 22:28:31 +0100
committerPhilipp Stephani2021-01-10 22:31:22 +0100
commit94344d130c2c2db90bcc47e12870d1d58f020ecf (patch)
tree58eac6671be87a7c662cc1ee0f591a8e0aee7586 /src/buffer.c
parentc7c154bb5756e0ae71d342c5d8aabf725877f186 (diff)
downloademacs-94344d130c2c2db90bcc47e12870d1d58f020ecf.tar.gz
emacs-94344d130c2c2db90bcc47e12870d1d58f020ecf.zip
Add functions to open a file without quitting.
In some situations, e.g. when the Lisp machinery isn't available, we can't quit. Don't check the quit flags in such situations, in case they contain garbage. * src/sysdep.c (emacs_open_noquit, emacs_openat_noquit): New variants of 'emacs_open' and 'emacs_openat' that don't check the quit flags. * src/emacs.c (main, Fdaemon_initialized): * src/pdumper.c (pdumper_load): * src/w32term.c (w32_initialize): * src/buffer.c (mmap_init): * src/callproc.c (emacs_spawn): Use them where we can't quit.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 71ad5edd527..80c799e719b 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4785,7 +4785,7 @@ mmap_init (void)
4785 if (mmap_fd <= 0) 4785 if (mmap_fd <= 0)
4786 { 4786 {
4787 /* No anonymous mmap -- we need the file descriptor. */ 4787 /* No anonymous mmap -- we need the file descriptor. */
4788 mmap_fd = emacs_open ("/dev/zero", O_RDONLY, 0); 4788 mmap_fd = emacs_open_noquit ("/dev/zero", O_RDONLY, 0);
4789 if (mmap_fd == -1) 4789 if (mmap_fd == -1)
4790 fatal ("Cannot open /dev/zero: %s", emacs_strerror (errno)); 4790 fatal ("Cannot open /dev/zero: %s", emacs_strerror (errno));
4791 } 4791 }