From ba1ed52f0c2c7fd15fe1feadabfd0af88e19b4c3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 14 Jul 2014 12:23:18 -0700 Subject: Use binary-io module, O_BINARY, and "b" flag. * admin/merge-gnulib (GNULIB_MODULES): Add binary-io. It was already present implicitly; this just makes the dependence explicit. * lib-src/etags.c, lib-src/hexl.c, lib-src/make-docfile.c: Include binary-io.h instead of fcntl.h and/or io.h. (main): Use set_binary_mode or SET_BINARY in place of handcrafted code. * lib-src/etags.c (main) [DOS_NT]: * lib-src/movemail.c (main) [WINDOWSNT]: Don't mess with _fmode. * lib-src/etags.c (main, process_file_name, analyse_regex): Use fopen/popen's "b" flag instead. * lib-src/movemail.c (main, popmail): Use open/lk_open/mkostemp's O_BINARY instead. * src/callproc.c (create_temp_file): Use mkostemp's O_BINARY flag. * src/emacs.c [MSDOS]: * src/emacs.c (main) [DOS_NT]: Don't mess with _fmode. (main) [MSDOS]: Use SET_BINARY instead of setmode. * src/minibuf.c: Include binary-io.h instead of fcntl.h. (read_minibuf_noninteractive): Use set_binary_mode instead of handcrafted code. Don't call emacs_set_tty if emacs_get_tty failed. * src/sysdep.c, src/systty.h (emacs_get_tty): Return int, not void. * src/sysdep.c (emacs_open, emacs_pipe): Use O_BINARY. * src/w32.c (pipe2): Adjust eassert to include O_BINARY. Fixes: debbugs:18006 --- src/systty.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/systty.h') diff --git a/src/systty.h b/src/systty.h index dcab0268393..a29c4933d7b 100644 --- a/src/systty.h +++ b/src/systty.h @@ -80,7 +80,7 @@ struct emacs_tty { }; /* From sysdep.c or w32.c */ -extern void emacs_get_tty (int, struct emacs_tty *) EXTERNALLY_VISIBLE; +extern int emacs_get_tty (int, struct emacs_tty *) EXTERNALLY_VISIBLE; extern int emacs_set_tty (int, struct emacs_tty *, bool) EXTERNALLY_VISIBLE; extern void suppress_echo_on_tty (int); extern int serial_open (Lisp_Object); -- cgit v1.2.1