aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2006-12-04 12:27:09 +0000
committerKim F. Storm2006-12-04 12:27:09 +0000
commit8247c60d3b72d15a668b43ab4dfbf714ab0c4751 (patch)
treeb6da277d04ea00ac42db9b199e92ba4c816cef09 /src
parent8ddd297d1daf7a1589b59d8300fc1c36a9641ae5 (diff)
downloademacs-8247c60d3b72d15a668b43ab4dfbf714ab0c4751.tar.gz
emacs-8247c60d3b72d15a668b43ab4dfbf714ab0c4751.zip
(handle_USR1_signal, handle_USR2_signal): Replace by...
(handle_user_signal): ... this, which generates two USER_SIGNAL_EVENTs first with code == 0 [signal] and one with code == sig number. (main): Use it as handler for SIGUR1 and SIGUSR2.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 1377a3d6b37..6f3301b4c83 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -361,9 +361,9 @@ pthread_t main_thread;
361#endif 361#endif
362 362
363 363
364#ifdef SIGUSR1 364#if defined (SIGUSR1) || defined (SIGUSR2)
365SIGTYPE 365SIGTYPE
366handle_USR1_signal (sig) 366handle_user_signal (sig)
367 int sig; 367 int sig;
368{ 368{
369 struct input_event buf; 369 struct input_event buf;
@@ -374,25 +374,10 @@ handle_USR1_signal (sig)
374 buf.frame_or_window = selected_frame; 374 buf.frame_or_window = selected_frame;
375 375
376 kbd_buffer_store_event (&buf); 376 kbd_buffer_store_event (&buf);
377} 377 buf.code = sig;
378#endif /* SIGUSR1 */
379
380#ifdef SIGUSR2
381SIGTYPE
382handle_USR2_signal (sig)
383 int sig;
384{
385 struct input_event buf;
386
387 SIGNAL_THREAD_CHECK (sig);
388 bzero (&buf, sizeof buf);
389 buf.kind = USER_SIGNAL_EVENT;
390 buf.code = 1;
391 buf.frame_or_window = selected_frame;
392
393 kbd_buffer_store_event (&buf); 378 kbd_buffer_store_event (&buf);
394} 379}
395#endif /* SIGUSR2 */ 380#endif
396 381
397/* Handle bus errors, invalid instruction, etc. */ 382/* Handle bus errors, invalid instruction, etc. */
398SIGTYPE 383SIGTYPE
@@ -1226,10 +1211,10 @@ main (argc, argv
1226 signal (SIGILL, fatal_error_signal); 1211 signal (SIGILL, fatal_error_signal);
1227 signal (SIGTRAP, fatal_error_signal); 1212 signal (SIGTRAP, fatal_error_signal);
1228#ifdef SIGUSR1 1213#ifdef SIGUSR1
1229 signal (SIGUSR1, handle_USR1_signal); 1214 signal (SIGUSR1, handle_user_signal);
1230#ifdef SIGUSR2
1231 signal (SIGUSR2, handle_USR2_signal);
1232#endif 1215#endif
1216#ifdef SIGUSR2
1217 signal (SIGUSR2, handle_user_signal);
1233#endif 1218#endif
1234#ifdef SIGABRT 1219#ifdef SIGABRT
1235 signal (SIGABRT, fatal_error_signal); 1220 signal (SIGABRT, fatal_error_signal);