aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src/make-docfile.c
diff options
context:
space:
mode:
authorPaul Eggert2014-07-14 12:23:18 -0700
committerPaul Eggert2014-07-14 12:23:18 -0700
commitba1ed52f0c2c7fd15fe1feadabfd0af88e19b4c3 (patch)
tree5ef95ac07de2a856369957a7ac047b9f58b78594 /lib-src/make-docfile.c
parent091adafaac52ff409790728af63cab19bd52fc8f (diff)
downloademacs-ba1ed52f0c2c7fd15fe1feadabfd0af88e19b4c3.tar.gz
emacs-ba1ed52f0c2c7fd15fe1feadabfd0af88e19b4c3.zip
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
Diffstat (limited to 'lib-src/make-docfile.c')
-rw-r--r--lib-src/make-docfile.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 6692a0a6450..cb0a56607f8 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -38,17 +38,16 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38 38
39#include <stdio.h> 39#include <stdio.h>
40#include <stdlib.h> /* config.h unconditionally includes this anyway */ 40#include <stdlib.h> /* config.h unconditionally includes this anyway */
41#ifdef MSDOS 41
42#include <fcntl.h>
43#endif /* MSDOS */
44#ifdef WINDOWSNT 42#ifdef WINDOWSNT
45/* Defined to be sys_fopen in ms-w32.h, but only #ifdef emacs, so this 43/* Defined to be sys_fopen in ms-w32.h, but only #ifdef emacs, so this
46 is really just insurance. */ 44 is really just insurance. */
47#undef fopen 45#undef fopen
48#include <fcntl.h>
49#include <direct.h> 46#include <direct.h>
50#endif /* WINDOWSNT */ 47#endif /* WINDOWSNT */
51 48
49#include <binary-io.h>
50
52#ifdef DOS_NT 51#ifdef DOS_NT
53/* Defined to be sys_chdir in ms-w32.h, but only #ifdef emacs, so this 52/* Defined to be sys_chdir in ms-w32.h, but only #ifdef emacs, so this
54 is really just insurance. 53 is really just insurance.
@@ -167,19 +166,7 @@ main (int argc, char **argv)
167 ++i; 166 ++i;
168 } 167 }
169 168
170 /* Don't put CRs in the output file. */ 169 set_binary_mode (fileno (stdout), O_BINARY);
171#ifdef MSDOS
172 _fmode = O_BINARY;
173#if 0 /* Suspicion is that this causes hanging.
174 So instead we require people to use -o on MSDOS. */
175 (stdout)->_flag &= ~_IOTEXT;
176 _setmode (fileno (stdout), O_BINARY);
177#endif
178#endif /* MSDOS */
179#ifdef WINDOWSNT
180 _fmode = O_BINARY;
181 _setmode (fileno (stdout), O_BINARY);
182#endif /* WINDOWSNT */
183 170
184 if (generate_globals) 171 if (generate_globals)
185 start_globals (); 172 start_globals ();