aboutsummaryrefslogtreecommitdiffstats
path: root/src/emacs.c
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1996-04-10 01:00:12 +0000
committerRichard M. Stallman <[email protected]>1996-04-10 01:00:12 +0000
commit18198bb2094e73df6db684301b2c152a16dbb010 (patch)
tree95642b7f4620a0c5e89407c13a24e7846cf2430a /src/emacs.c
parent515dd7113c71d46f0cab93e9910aac31f5b7d125 (diff)
(main) [MSDOS]: Handle DJGPP version 2.
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 3b221a108e..b6e97bc8c9 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -532,9 +532,20 @@ main (argc, argv, envp)
/* We do all file input/output as binary files. When we need to translate
newlines, we do that manually. */
_fmode = O_BINARY;
+
+#if __DJGPP__ >= 2
+ if (!isatty (fileno (stdin)))
+ setmode (fileno (stdin), O_BINARY);
+ if (!isatty (fileno (stdout)))
+ {
+ fflush (stdout);
+ setmode (fileno (stdout), O_BINARY);
+ }
+#else /* not __DJGPP__ >= 2 */
(stdin)->_flag &= ~_IOTEXT;
(stdout)->_flag &= ~_IOTEXT;
(stderr)->_flag &= ~_IOTEXT;
+#endif /* not __DJGPP__ >= 2 */
#endif /* MSDOS */
#ifdef SET_EMACS_PRIORITY
@@ -776,9 +787,17 @@ Usage: %s [-t term] [--terminal term] [-nw] [--no-windows] [--batch]\n\
/* Call early 'cause init_environment needs it. */
init_dosfns ();
/* Set defaults for several environment variables. */
- if (initialized) init_environment (argc, argv, skip_args);
- else init_gettimeofday ();
+ if (initialized)
+ init_environment (argc, argv, skip_args);
+ else
+ {
+#if __DGJPP__ >= 2
+ tzset ();
+#else
+ init_gettimeofday ();
#endif
+ }
+#endif /* MSDOS */
#ifdef WINDOWSNT
/* Initialize environment from registry settings. */