diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-07-05 19:40:50 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-07-05 19:40:50 -0700 |
commit | 406af475be236b874e3633b68999f6a099d47587 (patch) | |
tree | 4dfc0e61b3fce353adedc96f84091aca4ae23b57 /src/dispnew.c | |
parent | 0773c610689c7612b0d7b44e61701079b6f56419 (diff) |
Use emacs_open more consistently when opening files.
This handles EINTR more consistently now, and makes it easier
to introduce other uniform changes to file descriptor handling.
* src/systdio.h: New file.
* src/buffer.c (mmap_init):
* cygw32.c (chdir_to_default_directory):
* dispnew.c (Fopen_termscript):
* emacs.c (Fdaemon_initialized):
* fileio.c (Fdo_auto_save):
* image.c (slurp_file, png_load_body, jpeg_load_body):
* keyboard.c (Fopen_dribble_file):
* lread.c (Fload):
* print.c (Fredirect_debugging_output):
* sysdep.c (get_up_time, procfs_ttyname, procfs_get_total_memory):
* termcap.c (tgetent):
* unexaix.c, unexcoff.c (unexec, adjust_lnnoptrs):
* unexcw.c, unexelf.c, unexhp9k800.c, unexmacosx.c (unexec):
* w32term.c (w32_initialize) [CYGWIN]:
* xfaces.c (Fx_load_color_file):
Use emacs_open instead of plain open, and emacs_fopen instead of
plain fopen.
* dispnew.c, fileio.c, image.c, keyboard.c, lread.c, print.c, sysdep.c:
* xfaces.c: Include sysstdio.h rather than stdio.h, for emacs_fopen.
* callproc.c (default_output_mode): New constant.
(Fcall_process): Use it to call emacs_open instead of plain creat.
* dispnew.c (Fopen_termscript): Fix minor race in opening termscript.
* sysdep.c (emacs_open): Add commentary and don't call file name "path".
(emacs_fopen): New function.
* unexaix.c, unexcoff.c, unexelf.c, unexhp9k800.c, unexmacosx.c:
Include <lisp.h>, for emacs_open.
* unexelf.c (fatal): Remove decl; not needed with <lisp.h> included.
Diffstat (limited to 'src/dispnew.c')
-rw-r--r-- | src/dispnew.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index b4ca654a8f..31b8a1310e 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -22,7 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #define DISPEXTERN_INLINE EXTERN_INLINE -#include <stdio.h> +#include "sysstdio.h" #include <unistd.h> #include "lisp.h" @@ -5605,17 +5605,17 @@ FILE = nil means just close any termscript file currently open. */) tty = CURTTY (); if (tty->termscript != 0) - { - block_input (); - fclose (tty->termscript); - unblock_input (); - } - tty->termscript = 0; + { + block_input (); + fclose (tty->termscript); + tty->termscript = 0; + unblock_input (); + } if (! NILP (file)) { file = Fexpand_file_name (file, Qnil); - tty->termscript = fopen (SSDATA (file), "w"); + tty->termscript = emacs_fopen (SSDATA (file), "w"); if (tty->termscript == 0) report_file_error ("Opening termscript", Fcons (file, Qnil)); } |