changeset 14968:1351c75bc3d6

(main) [MSDOS]: Handle DJGPP version 2.
author Richard M. Stallman <rms@gnu.org>
date Wed, 10 Apr 1996 01:00:12 +0000
parents 5c431b2e0f95
children ea072e2f75f8
files lib-src/b2m.c src/emacs.c
diffstat 2 files changed, 28 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/b2m.c	Wed Apr 10 00:53:52 1996 +0000
+++ b/lib-src/b2m.c	Wed Apr 10 01:00:12 1996 +0000
@@ -89,8 +89,15 @@
 
 #ifdef MSDOS
   _fmode = O_BINARY;		/* all of files are treated as binary files */
+#if __DJGPP__ > 1
+  if (!isatty (fileno (stdout)))
+    setmode (fileno (stdout), O_BINARY);
+  if (!isatty (fileno (stdin)))
+    setmode (fileno (stdin), O_BINARY);
+#else /* not __DJGPP__ > 1 */
   (stdout)->_flag &= ~_IOTEXT;
   (stdin)->_flag &= ~_IOTEXT;
+#endif /* not __DJGPP__ > 1 */
 #endif
   progname = argv[0];
 
--- a/src/emacs.c	Wed Apr 10 00:53:52 1996 +0000
+++ b/src/emacs.c	Wed Apr 10 01:00:12 1996 +0000
@@ -532,9 +532,20 @@
   /* 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 @@
   /* 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.  */