Changeset adee9cc
- Timestamp:
- May 4, 2009, 9:55:11 PM (16 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- d6bd3f1
- Parents:
- 790ab12
- git-author:
- Nelson Elhage <nelhage@mit.edu> (05/03/09 15:31:50)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (05/04/09 21:55:11)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
global.c
rf34dd65 radee9cc 116 116 owl_list_create(&(g->dispatchlist)); 117 117 g->timerlist = NULL; 118 g->interrupted = FALSE; 118 119 } 119 120 … … 934 935 return &(g->timerlist); 935 936 } 937 938 /* 939 * Note: This must be called with SIGINT masked in order to avoid 940 * races. This will unset the interrupt flag and unblock SIGINT before 941 * returning. 942 */ 943 int owl_global_is_interrupted(owl_global *g) { 944 int interrupted; 945 sigset_t intr; 946 sigemptyset(&intr); 947 sigaddset(&intr, SIGINT); 948 949 interrupted = g->interrupted; 950 g->interrupted = 0; 951 952 sigprocmask(SIG_UNBLOCK, &intr, NULL); 953 return interrupted; 954 } 955 956 void owl_global_set_interrupted(owl_global *g) { 957 g->interrupted = 1; 958 } 959 960 void owl_global_unset_interrupted(owl_global *g) { 961 g->interrupted = 0; 962 } -
owl.c
r5657d53 radee9cc 137 137 sigaction(SIGHUP, &sigact, NULL); 138 138 139 sigact.sa_sigaction=sigint_handler; 140 sigaction(SIGINT, &sigact, NULL); 141 139 142 /* save initial terminal settings */ 140 143 tcgetattr(0, owl_global_get_startup_tio(&g)); … … 156 159 use_default_colors(); 157 160 #endif 158 raw();161 cbreak(); 159 162 noecho(); 160 163 … … 675 678 } 676 679 680 void sigint_handler(int sig, siginfo_t *si, void *data) 681 { 682 owl_global_set_interrupted(&g); 683 } 684 677 685 void usage() 678 686 { -
owl.h
r4a999a7 radee9cc 595 595 owl_timer *aim_nop_timer; 596 596 int load_initial_subs; 597 int interrupted; 597 598 } owl_global; 598 599 -
select.c
r1895c29 radee9cc 326 326 327 327 if ( select(max_fd+1, &r, &aim_wfds, &e, &timeout) ) { 328 owl_global_unset_interrupted(&g); 328 329 /* Merge fd_sets and clear AIM FDs. */ 329 330 for(i = 0; i <= max_fd; i++) {
Note: See TracChangeset
for help on using the changeset viewer.