aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2016-09-05 19:50:59 +0300
committerEli Zaretskii2016-09-05 19:50:59 +0300
commitcfaf18a27c262694750400005e882f1cfc7ff2b0 (patch)
treecf5b3cb11a3dd8ba29f63d64163f5cdae7bd47b6 /src
parent62e4dc4660cb3b29cfffcad0639e51c7f382ced8 (diff)
downloademacs-cfaf18a27c262694750400005e882f1cfc7ff2b0.tar.gz
emacs-cfaf18a27c262694750400005e882f1cfc7ff2b0.zip
Treat SIGINT correctly in GUI sessions on MS-Windows
* src/w32proc.c (sys_signal): Don't reject SIGINT, as it is supported by MS runtime. * src/term.c (DEV_TTY): Move from here ... * src/conf_post.h (DEV_TTY): ... to here. Separate definitions for WINDOWSNT and for the rest. * src/keyboard.c (handle_interrupt_signal): Use DEV_TTY instead of a literal "/dev/tty". * etc/NEWS: Mention the behavior change.
Diffstat (limited to 'src')
-rw-r--r--src/conf_post.h9
-rw-r--r--src/keyboard.c2
-rw-r--r--src/term.c3
-rw-r--r--src/w32proc.c4
4 files changed, 12 insertions, 6 deletions
diff --git a/src/conf_post.h b/src/conf_post.h
index 865d0183a57..bc8b0964882 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -140,6 +140,10 @@ typedef bool bool_bf;
140#undef HAVE_RINT 140#undef HAVE_RINT
141#endif /* HPUX */ 141#endif /* HPUX */
142 142
143#ifdef WINDOWSNT
144# define DEV_TTY "CONOUT$"
145#endif
146
143#ifdef MSDOS 147#ifdef MSDOS
144#ifndef __DJGPP__ 148#ifndef __DJGPP__
145You lose; /* Emacs for DOS must be compiled with DJGPP */ 149You lose; /* Emacs for DOS must be compiled with DJGPP */
@@ -242,6 +246,11 @@ extern int emacs_setenv_TZ (char const *);
242#include <string.h> 246#include <string.h>
243#include <stdlib.h> 247#include <stdlib.h>
244 248
249#ifndef DEV_TTY
250# define DEV_TTY "/dev/tty"
251#endif
252
253
245#if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */ 254#if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */
246#define NO_INLINE __attribute__((noinline)) 255#define NO_INLINE __attribute__((noinline))
247#else 256#else
diff --git a/src/keyboard.c b/src/keyboard.c
index e44155260f8..3ef797c11c3 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -10241,7 +10241,7 @@ static void
10241handle_interrupt_signal (int sig) 10241handle_interrupt_signal (int sig)
10242{ 10242{
10243 /* See if we have an active terminal on our controlling tty. */ 10243 /* See if we have an active terminal on our controlling tty. */
10244 struct terminal *terminal = get_named_terminal ("/dev/tty"); 10244 struct terminal *terminal = get_named_terminal (DEV_TTY);
10245 if (!terminal) 10245 if (!terminal)
10246 { 10246 {
10247 /* If there are no frames there, let's pretend that we are a 10247 /* If there are no frames there, let's pretend that we are a
diff --git a/src/term.c b/src/term.c
index d54ff115f9d..cb684b3aaa6 100644
--- a/src/term.c
+++ b/src/term.c
@@ -58,10 +58,7 @@ static int been_here = -1;
58 58
59/* The name of the default console device. */ 59/* The name of the default console device. */
60#ifdef WINDOWSNT 60#ifdef WINDOWSNT
61#define DEV_TTY "CONOUT$"
62#include "w32term.h" 61#include "w32term.h"
63#else
64#define DEV_TTY "/dev/tty"
65#endif 62#endif
66 63
67static void tty_set_scroll_region (struct frame *f, int start, int stop); 64static void tty_set_scroll_region (struct frame *f, int start, int stop);
diff --git a/src/w32proc.c b/src/w32proc.c
index 11a121f7c09..217d005a363 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -86,9 +86,9 @@ sys_signal (int sig, signal_handler handler)
86 /* SIGCHLD is needed for supporting subprocesses, see sys_kill 86 /* SIGCHLD is needed for supporting subprocesses, see sys_kill
87 below. SIGALRM and SIGPROF are used by setitimer. All the 87 below. SIGALRM and SIGPROF are used by setitimer. All the
88 others are the only ones supported by the MS runtime. */ 88 others are the only ones supported by the MS runtime. */
89 if (!(sig == SIGCHLD || sig == SIGSEGV || sig == SIGILL 89 if (!(sig == SIGINT || sig == SIGSEGV || sig == SIGILL
90 || sig == SIGFPE || sig == SIGABRT || sig == SIGTERM 90 || sig == SIGFPE || sig == SIGABRT || sig == SIGTERM
91 || sig == SIGALRM || sig == SIGPROF)) 91 || sig == SIGCHLD || sig == SIGALRM || sig == SIGPROF))
92 { 92 {
93 errno = EINVAL; 93 errno = EINVAL;
94 return SIG_ERR; 94 return SIG_ERR;