aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-04-10 01:00:12 +0000
committerRichard M. Stallman1996-04-10 01:00:12 +0000
commit18198bb2094e73df6db684301b2c152a16dbb010 (patch)
tree95642b7f4620a0c5e89407c13a24e7846cf2430a
parent515dd7113c71d46f0cab93e9910aac31f5b7d125 (diff)
downloademacs-18198bb2094e73df6db684301b2c152a16dbb010.tar.gz
emacs-18198bb2094e73df6db684301b2c152a16dbb010.zip
(main) [MSDOS]: Handle DJGPP version 2.
-rw-r--r--lib-src/b2m.c7
-rw-r--r--src/emacs.c23
2 files changed, 28 insertions, 2 deletions
diff --git a/lib-src/b2m.c b/lib-src/b2m.c
index 9da7a91b60f..88d0acd5cd8 100644
--- a/lib-src/b2m.c
+++ b/lib-src/b2m.c
@@ -89,8 +89,15 @@ main (argc, argv)
89 89
90#ifdef MSDOS 90#ifdef MSDOS
91 _fmode = O_BINARY; /* all of files are treated as binary files */ 91 _fmode = O_BINARY; /* all of files are treated as binary files */
92#if __DJGPP__ > 1
93 if (!isatty (fileno (stdout)))
94 setmode (fileno (stdout), O_BINARY);
95 if (!isatty (fileno (stdin)))
96 setmode (fileno (stdin), O_BINARY);
97#else /* not __DJGPP__ > 1 */
92 (stdout)->_flag &= ~_IOTEXT; 98 (stdout)->_flag &= ~_IOTEXT;
93 (stdin)->_flag &= ~_IOTEXT; 99 (stdin)->_flag &= ~_IOTEXT;
100#endif /* not __DJGPP__ > 1 */
94#endif 101#endif
95 progname = argv[0]; 102 progname = argv[0];
96 103
diff --git a/src/emacs.c b/src/emacs.c
index 3b221a108ec..b6e97bc8c9e 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -532,9 +532,20 @@ main (argc, argv, envp)
532 /* We do all file input/output as binary files. When we need to translate 532 /* We do all file input/output as binary files. When we need to translate
533 newlines, we do that manually. */ 533 newlines, we do that manually. */
534 _fmode = O_BINARY; 534 _fmode = O_BINARY;
535
536#if __DJGPP__ >= 2
537 if (!isatty (fileno (stdin)))
538 setmode (fileno (stdin), O_BINARY);
539 if (!isatty (fileno (stdout)))
540 {
541 fflush (stdout);
542 setmode (fileno (stdout), O_BINARY);
543 }
544#else /* not __DJGPP__ >= 2 */
535 (stdin)->_flag &= ~_IOTEXT; 545 (stdin)->_flag &= ~_IOTEXT;
536 (stdout)->_flag &= ~_IOTEXT; 546 (stdout)->_flag &= ~_IOTEXT;
537 (stderr)->_flag &= ~_IOTEXT; 547 (stderr)->_flag &= ~_IOTEXT;
548#endif /* not __DJGPP__ >= 2 */
538#endif /* MSDOS */ 549#endif /* MSDOS */
539 550
540#ifdef SET_EMACS_PRIORITY 551#ifdef SET_EMACS_PRIORITY
@@ -776,9 +787,17 @@ Usage: %s [-t term] [--terminal term] [-nw] [--no-windows] [--batch]\n\
776 /* Call early 'cause init_environment needs it. */ 787 /* Call early 'cause init_environment needs it. */
777 init_dosfns (); 788 init_dosfns ();
778 /* Set defaults for several environment variables. */ 789 /* Set defaults for several environment variables. */
779 if (initialized) init_environment (argc, argv, skip_args); 790 if (initialized)
780 else init_gettimeofday (); 791 init_environment (argc, argv, skip_args);
792 else
793 {
794#if __DGJPP__ >= 2
795 tzset ();
796#else
797 init_gettimeofday ();
781#endif 798#endif
799 }
800#endif /* MSDOS */
782 801
783#ifdef WINDOWSNT 802#ifdef WINDOWSNT
784 /* Initialize environment from registry settings. */ 803 /* Initialize environment from registry settings. */