Changeset b752f1e
- Timestamp:
- Dec 19, 2009, 10:19:04 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1247aaa
- Parents:
- 99c1f46
- git-author:
- Nelson Elhage <nelhage@mit.edu> (12/16/09 17:50:34)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (12/19/09 22:19:04)
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
global.c
r129e609 rb752f1e 117 117 g->timerlist = NULL; 118 118 g->interrupted = FALSE; 119 g->got_sigtstp = FALSE;120 119 } 121 120 … … 963 962 g->interrupted = 0; 964 963 } 965 966 int owl_global_is_sigstp(const owl_global *g) {967 return g->got_sigtstp;968 }969 970 void owl_global_set_got_sigstp(owl_global *g) {971 g->got_sigtstp = 1;972 }973 974 void owl_global_unset_got_sigstp(owl_global *g) {975 g->got_sigtstp = 0;976 } -
keys.c
rdbe172d rb752f1e 21 21 "System-wide default key bindings", 22 22 owl_keys_default_invalid, NULL, NULL); 23 BIND_CMD("C-z", " suspend", "Suspend owl");23 BIND_CMD("C-z", "message Use :suspend to suspend.", ""); 24 24 25 25 /****************************************************************/ -
owl.c
r129e609 rb752f1e 135 135 tcgetattr(0, owl_global_get_startup_tio(&g)); 136 136 137 /* turn ISTRIP off */138 137 tcgetattr(0, &tio); 139 138 tio.c_iflag &= ~(ISTRIP|IEXTEN); 140 139 tio.c_cc[VQUIT] = 0; 140 tio.c_cc[VSUSP] = 0; 141 141 tcsetattr(0, TCSAFLUSH, &tio); 142 142 … … 396 396 } 397 397 398 void sigtstp_handler(int sig, siginfo_t *si, void *data)399 {400 owl_global_set_got_sigstp(&g);401 }402 403 398 void owl_register_signal_handlers(void) { 404 399 struct sigaction sigact; … … 417 412 sigact.sa_sigaction=sigint_handler; 418 413 sigaction(SIGINT, &sigact, NULL); 419 420 sigact.sa_sigaction=sigtstp_handler;421 sigaction(SIGTSTP, &sigact, NULL);422 414 } 423 415 -
owl.h
r129e609 rb752f1e 610 610 int load_initial_subs; 611 611 int interrupted; 612 int got_sigtstp;613 612 } owl_global; 614 613 -
select.c
r7ca5d3e rb752f1e 303 303 sigemptyset(&set); 304 304 sigaddset(&set, SIGINT); 305 sigaddset(&set, SIGTSTP);306 305 sigprocmask(SIG_BLOCK, &set, oldmask); 307 306 } … … 317 316 in.ch = in.uch = owl_global_get_startup_tio(&g)->c_cc[VINTR]; 318 317 owl_process_input_char(in); 319 }320 321 void owl_select_check_tstp(void) {322 if(owl_global_is_sigstp(&g)) {323 owl_function_makemsg("Use :suspend to suspend.");324 owl_global_unset_got_sigstp(&g);325 }326 318 } 327 319 … … 398 390 owl_select_mask_signals(&mask); 399 391 400 owl_select_check_tstp();401 392 if(owl_global_is_interrupted(&g)) { 402 393 owl_select_handle_intr(&mask); … … 447 438 448 439 if(ret < 0 && errno == EINTR) { 449 owl_select_check_tstp();450 440 if(owl_global_is_interrupted(&g)) { 451 441 owl_select_handle_intr(NULL);
Note: See TracChangeset
for help on using the changeset viewer.