Coverity fixes
[sxemacs] / src / signal.c
1 /* Handling asynchronous signals.
2    Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
3    Copyright (C) 1995, 1996 Ben Wing.
4
5 This file is part of SXEmacs
6
7 SXEmacs is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 SXEmacs is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
19
20
21 /* Synched up with: Not synched with FSF.  Split out of keyboard.c. */
22
23 #include <config.h>
24 #include "lisp.h"
25
26 #include "ui/console.h"
27 #include "events/events.h"              /* for signal_fake_event() */
28 #include "ui/frame.h"
29 #include "sysdep.h"
30 #include "syssignal.h"
31 #include "systime.h"
32
33 #include "sysfile.h"
34
35 /* Set to 1 when a quit-check signal (either a SIGIO interrupt or
36    the asynch. timeout for poll-for-quit) occurs.  The QUITP
37    macro may look at this. */
38 volatile int quit_check_signal_happened;
39
40 /* Count of the number of times a quit-check signal has occurred.
41    Some stuff in event-Xt.c looks at this. */
42 volatile int quit_check_signal_tick_count;
43
44 /* Set to 1 when a SIGINT (or SIGQUIT) interrupt is processed.
45    maybe_read_quit_event() looks at this. */
46 volatile int sigint_happened;
47
48 /* Set to 1 when an asynch. timeout signal occurs. */
49 static volatile int alarm_happened;
50
51 /* This is used to synchronize setting the waiting_for_user_input_p
52    flag. */
53 static volatile int alarm_happened_while_emacs_was_blocking;
54
55 /* See check_quit() for when this is set. */
56 int dont_check_for_quit;
57
58 #if !defined (SIGIO) && !defined (DONT_POLL_FOR_QUIT)
59 int poll_for_quit_id;
60 #endif