emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/term.c,v


From: Eli Zaretskii
Subject: [Emacs-diffs] Changes to emacs/src/term.c,v
Date: Sat, 22 Sep 2007 12:40:58 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Eli Zaretskii <eliz>    07/09/22 12:40:58

Index: term.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/term.c,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -b -r1.201 -r1.202
--- term.c      21 Sep 2007 20:19:09 -0000      1.201
+++ term.c      22 Sep 2007 12:40:57 -0000      1.202
@@ -84,6 +84,13 @@
 #define O_NOCTTY 0
 #endif
 
+/* The name of the default console device.  */
+#ifdef WINDOWSNT
+#define DEV_TTY  "CONOUT$"
+#else
+#define DEV_TTY  "/dev/tty"
+#endif
+
 static void tty_set_scroll_region P_ ((struct frame *f, int start, int stop));
 static void turn_on_face P_ ((struct frame *, int face_id));
 static void turn_off_face P_ ((struct frame *, int face_id));
@@ -180,17 +187,6 @@
 static void term_mouse_highlight (struct frame *f, int x, int y);
 
 
-#ifdef WINDOWSNT
-/* We aren't X windows, but we aren't termcap either.  This makes me
-   uncertain as to what value to use for frame.output_method.  For
-   this file, we'll define FRAME_TERMCAP_P to be zero so that our
-   output hooks get called instead of the termcap functions.  Probably
-   the best long-term solution is to define an output_windows_nt...  */
-
-#undef FRAME_TERMCAP_P
-#define FRAME_TERMCAP_P(_f_) 0
-#endif /* WINDOWSNT */
-
 #ifdef HAVE_GPM
 #include <sys/fcntl.h>
 #include "buffer.h"
@@ -2185,7 +2181,7 @@
 {
   struct terminal *t = get_terminal (terminal, 1);
 
-  if (t->type != output_termcap || strcmp (t->display_info.tty->name, 
"/dev/tty"))
+  if (t->type != output_termcap || strcmp (t->display_info.tty->name, DEV_TTY))
     return Qnil;
   else
     return Qt;
@@ -2313,7 +2309,7 @@
       if (fd == -1)
         error ("Can not reopen tty device %s: %s", t->display_info.tty->name, 
strerror (errno));
 
-      if (strcmp (t->display_info.tty->name, "/dev/tty"))
+      if (strcmp (t->display_info.tty->name, DEV_TTY))
         dissociate_if_controlling_tty (fd);
       
       t->display_info.tty->output = fdopen (fd, "w+");
@@ -3140,7 +3136,7 @@
 #else
 #ifdef TIOCNOTTY                /* Try BSD ioctls. */
       sigblock (sigmask (SIGTTOU));
-      fd = emacs_open ("/dev/tty", O_RDWR, 0);
+      fd = emacs_open (DEV_TTY, O_RDWR, 0);
       if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1)
         {
           no_controlling_tty = 1;
@@ -3154,7 +3150,7 @@
 #endif  /* ! TIOCNOTTY */
 #endif  /* ! USG */
     }
-#endif
+#endif /* !WINDOWSNT */
 }
 
 static void maybe_fatal();
@@ -3188,10 +3184,9 @@
                  "Unknown terminal type",
                  "Unknown terminal type");
 
-#ifndef WINDOWSNT  
   if (name == NULL)
-    name = "/dev/tty";
-  if (!strcmp (name, "/dev/tty"))
+    name = DEV_TTY;
+  if (!strcmp (name, DEV_TTY))
     ctty = 1;
 
   /* If we already have a terminal on the given device, use that.  If
@@ -3202,7 +3197,6 @@
   terminal = get_named_tty (name);
   if (terminal)
     return terminal;
-#endif
   
   terminal = create_terminal ();
   tty = (struct tty_display_info *) xmalloc (sizeof (struct tty_display_info));
@@ -3284,12 +3278,8 @@
   terminal->delete_frame_hook = &delete_tty_output;
   terminal->delete_terminal_hook = &delete_tty;
 
-  /* XXX Can this be non-null?  */
-  if (name)
-    {
       tty->name = xstrdup (name);
       terminal->name = xstrdup (name);
-    }
   tty->type = xstrdup (terminal_type);  
 
   tty->output = stdout;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]