* src/conf_post.h (DEV_TTY): Move from here ...
* src/keyboard.c, src/keyboard.h: ... to here, as it doesn’t need
to be visible everywhere. Make it a constant.
* src/keyboard.c (handle_interrupt, Fset_quit_char):
* src/process.c (create_process): Prefer DEV_TTY to "/dev/tty".
#undef HAVE_RINT
#endif /* HPUX */
-#ifdef WINDOWSNT
-# define DEV_TTY "CONOUT$"
-#endif
-
#ifdef MSDOS
#ifndef __DJGPP__
You lose; /* Emacs for DOS must be compiled with DJGPP */
#include <string.h>
#include <stdlib.h>
-#ifndef DEV_TTY
-# define DEV_TTY "/dev/tty"
-#endif
-
-
#if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */
#define NO_INLINE __attribute__((noinline))
#else
# pragma GCC diagnostic ignored "-Wclobbered"
#endif
+#ifdef WINDOWSNT
+char const DEV_TTY[] = "CONOUT$";
+#else
+char const DEV_TTY[] = "/dev/tty";
+#endif
+
/* Variables for blockinput.h: */
/* Positive if interrupt input is blocked right now. */
cancel_echoing ();
/* XXX This code needs to be revised for multi-tty support. */
- if (!NILP (Vquit_flag) && get_named_terminal ("/dev/tty"))
+ if (!NILP (Vquit_flag) && get_named_terminal (DEV_TTY))
{
if (! in_signal_handler)
{
See also `current-input-mode'. */)
(Lisp_Object quit)
{
- struct terminal *t = get_named_terminal ("/dev/tty");
+ struct terminal *t = get_named_terminal (DEV_TTY);
struct tty_display_info *tty;
if (!t)
extern const char *const lispy_function_keys[];
#endif
+extern char const DEV_TTY[];
+
INLINE_HEADER_END
#endif /* EMACS_KEYBOARD_H */
{
/* I wonder: would just ioctl (0, TIOCNOTTY, 0) work here?
I can't test it since I don't have 4.3. */
- int j = emacs_open ("/dev/tty", O_RDWR, 0);
+ int j = emacs_open (DEV_TTY, O_RDWR, 0);
if (j >= 0)
{
ioctl (j, TIOCNOTTY, 0);
/* Create a termcap display on the tty device with the given name and
type.
- If NAME is NULL, then use the controlling tty, i.e., "/dev/tty".
+ If NAME is NULL, then use the controlling tty, i.e., DEV_TTY.
Otherwise NAME should be a path to the tty device file,
e.g. "/dev/pts/7".