Changeset 8402a093


Ignore:
Timestamp:
Sep 18, 2010, 3:14:30 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
3ecd78b
Parents:
10dd8e6
git-author:
David Benjamin <davidben@mit.edu> (09/14/10 16:40:42)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 15:14:30)
Message:
Move the error signal logging to a pre_select_action

This reduces our event loop to owl_select.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.c

    re488ec5 r8402a093  
    356356}
    357357
     358static int owl_errsignal_pre_select_action(owl_ps_action *a, void *data)
     359{
     360  siginfo_t si;
     361  int signum;
     362  if ((signum = owl_global_get_errsignal_and_clear(&g, &si)) > 0) {
     363    owl_function_error("Got unexpected signal: %d %s  (code: %d band: %ld  errno: %d)",
     364        signum, signum==SIGPIPE?"SIGPIPE":"SIG????",
     365        si.si_code, si.si_band, si.si_errno);
     366  }
     367  return 0;
     368}
     369
    358370void owl_register_signal_handlers(void) {
    359371  struct sigaction sigact;
     
    569581  owl_select_add_pre_select_action(owl_refresh_pre_select_action, NULL, NULL);
    570582  owl_select_add_pre_select_action(owl_process_messages, NULL, NULL);
     583  owl_select_add_pre_select_action(owl_errsignal_pre_select_action, NULL, NULL);
    571584
    572585  owl_function_debugmsg("startup: entering main loop");
     
    575588    /* select on FDs we know about. */
    576589    owl_select();
    577 
    578     /* Log any error signals */
    579     {
    580       siginfo_t si;
    581       int signum;
    582       if ((signum = owl_global_get_errsignal_and_clear(&g, &si)) > 0) {
    583         owl_function_error("Got unexpected signal: %d %s  (code: %d band: %ld  errno: %d)",
    584                            signum, signum==SIGPIPE?"SIGPIPE":"SIG????",
    585                            si.si_code, si.si_band, si.si_errno);
    586       }
    587     }
    588 
    589   }
    590 }
     590  }
     591}
Note: See TracChangeset for help on using the changeset viewer.