Changeset fafb842 for global.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
  • global.c

    rb279013 rfafb842  
    1616
    1717  g_type_init();
     18  g_thread_init(NULL);
    1819
    1920  owl_select_init();
     
    101102
    102103  owl_errqueue_init(&(g->errqueue));
    103   g->got_err_signal=0;
    104104
    105105  owl_zbuddylist_create(&(g->zbuddies));
     
    112112  owl_list_create(&(g->psa_list));
    113113  g->timerlist = NULL;
    114   g->interrupted = FALSE;
    115114  g->kill_buffer = NULL;
    116115}
     
    826825}
    827826
    828 void owl_global_set_errsignal(owl_global *g, int signum, siginfo_t *siginfo)
    829 {
    830   g->got_err_signal = signum;
    831   if (siginfo) {
    832     g->err_signal_info = *siginfo;
    833   } else {
    834     siginfo_t si;
    835     memset(&si, 0, sizeof(si));
    836     g->err_signal_info = si;
    837   }
    838 }
    839 
    840 int owl_global_get_errsignal_and_clear(owl_global *g, siginfo_t *siginfo)
    841 {
    842   int signum;
    843   if (siginfo && g->got_err_signal) {
    844     *siginfo = g->err_signal_info;
    845   }
    846   signum = g->got_err_signal;
    847   g->got_err_signal = 0;
    848   return signum;
    849 }
    850 
    851 
    852827owl_zbuddylist *owl_global_get_zephyr_buddylist(owl_global *g)
    853828{
     
    888863{
    889864  return &(g->timerlist);
    890 }
    891 
    892 int owl_global_is_interrupted(const owl_global *g) {
    893   return g->interrupted;
    894 }
    895 
    896 void owl_global_set_interrupted(owl_global *g) {
    897   g->interrupted = 1;
    898 }
    899 
    900 void owl_global_unset_interrupted(owl_global *g) {
    901   g->interrupted = 0;
    902865}
    903866
Note: See TracChangeset for help on using the changeset viewer.