Changeset 0cb6c26
- Timestamp:
- May 5, 2009, 1:30:07 AM (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:
- 1e6e74e
- Parents:
- e0473d2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
rbf66f4e r0cb6c26 2990 2990 int viewsize, i, curmsg, start; 2991 2991 owl_message *m; 2992 sigset_t intr;2993 sigemptyset(&intr);2994 sigaddset(&intr, SIGINT);2995 2992 2996 2993 v=owl_global_get_current_view(&g); … … 3035 3032 i--; 3036 3033 } 3037 sigprocmask(SIG_BLOCK, &intr,NULL);3034 owl_function_mask_sigint(NULL); 3038 3035 if(owl_global_is_interrupted(&g)) { 3039 3036 owl_global_unset_interrupted(&g); 3037 owl_function_unmask_sigint(NULL); 3040 3038 owl_function_makemsg("Search interrupted!"); 3041 3039 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 3042 3040 return; 3043 3041 } 3042 owl_function_unmask_sigint(NULL); 3044 3043 } 3045 3044 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); … … 3517 3516 return COLORS; 3518 3517 } 3518 3519 void owl_function_mask_sigint(sigset_t *oldmask) { 3520 sigset_t intr; 3521 3522 sigemptyset(&intr); 3523 sigaddset(&intr, SIGINT); 3524 sigprocmask(SIG_BLOCK, &intr, oldmask); 3525 } 3526 3527 void owl_function_unmask_sigint(sigset_t *oldmask) { 3528 sigset_t intr; 3529 3530 sigemptyset(&intr); 3531 sigaddset(&intr, SIGINT); 3532 sigprocmask(SIG_UNBLOCK, &intr, oldmask); 3533 } -
global.c
radee9cc r0cb6c26 936 936 } 937 937 938 /*939 * Note: This must be called with SIGINT masked in order to avoid940 * races. This will unset the interrupt flag and unblock SIGINT before941 * returning.942 */943 938 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; 939 return g->interrupted; 954 940 } 955 941 -
select.c
r3a84694 r0cb6c26 290 290 { 291 291 owl_input in; 292 293 owl_global_unset_interrupted(&g); 294 owl_function_unmask_sigint(NULL); 295 292 296 in.ch = in.uch = owl_global_get_startup_tio(&g)->c_cc[VINTR]; 293 297 owl_process_input_char(in); … … 301 305 fd_set aim_rfds, aim_wfds; 302 306 struct timespec timeout; 303 sigset_t mask, intr; 304 305 sigemptyset(&intr); 306 sigaddset(&intr, SIGINT); 307 sigset_t mask; 307 308 308 309 owl_select_process_timers(&timeout); 309 310 310 sigprocmask(SIG_BLOCK, &intr,&mask);311 owl_function_mask_sigint(&mask); 311 312 if(owl_global_is_interrupted(&g)) { 312 313 owl_select_handle_intr(); 313 314 return; 314 315 } … … 352 353 } 353 354 354 sigprocmask(SIG_UNBLOCK, &intr,NULL);355 owl_function_unmask_sigint(NULL); 355 356 356 357 if(ret > 0) {
Note: See TracChangeset
for help on using the changeset viewer.