aboutsummaryrefslogtreecommitdiffstats
path: root/src
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 /src
parent515dd7113c71d46f0cab93e9910aac31f5b7d125 (diff)
downloademacs-18198bb2094e73df6db684301b2c152a16dbb010.tar.gz
emacs-18198bb2094e73df6db684301b2c152a16dbb010.zip
(main) [MSDOS]: Handle DJGPP version 2.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c23
1 files changed, 21 insertions, 2 deletions
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. */