Changeset fafb842 for select.c


Ignore:
Timestamp:
Mar 25, 2011, 3:46:46 AM (13 years ago)
Author:
David Benjamin <davidben@mit.edu>
Children:
96ade35
Parents:
cd28517
git-author:
David Benjamin <davidben@mit.edu> (02/26/11 00:15:35)
git-committer:
David Benjamin <davidben@mit.edu> (03/25/11 03:46:46)
Message:
First go at sigwait-based signal handling

SIGINT doesn't quite work.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • select.c

    rb279013 rfafb842  
    335335    owl_function_makemsg("Unable to handle keypress");
    336336  }
    337 }
    338 
    339 void owl_select_mask_signals(sigset_t *oldmask) {
    340   sigset_t set;
    341 
    342   sigemptyset(&set);
    343   sigaddset(&set, SIGWINCH);
    344   sigaddset(&set, SIGALRM);
    345   sigaddset(&set, SIGPIPE);
    346   sigaddset(&set, SIGTERM);
    347   sigaddset(&set, SIGHUP);
    348   sigaddset(&set, SIGINT);
    349   sigprocmask(SIG_BLOCK, &set, oldmask);
    350 }
    351 
    352 void owl_select_handle_intr(sigset_t *restore)
    353 {
    354   owl_input in;
    355 
    356   owl_global_unset_interrupted(&g);
    357 
    358   sigprocmask(SIG_SETMASK, restore, NULL);
    359 
    360   in.ch = in.uch = owl_global_get_startup_tio(&g)->c_cc[VINTR];
    361   owl_process_input_char(in);
    362337}
    363338
Note: See TracChangeset for help on using the changeset viewer.