/[monit]/monit/event.c
ViewVC logotype

Diff of /monit/event.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.49 by martinp, Mon Sep 5 09:51:37 2005 UTC revision 1.50 by martinp, Sun Sep 25 20:59:49 2005 UTC
# Line 102  void Event_post(Service_T service, long Line 102  void Event_post(Service_T service, long
102       * that the error flag is set for the passed event, we will allow it (i.e.       * that the error flag is set for the passed event, we will allow it (i.e.
103       * event queue was flushed during monit reload and the service was in       * event queue was flushed during monit reload and the service was in
104       * failed state before reload) */       * failed state before reload) */
105      if(!state && !(service->error & id))      if(state != STATE_FAILED && !(service->error & id))
106        return;        return;
107    
108      /* Initialize event list and add first event. */      /* Initialize event list and add first event. */
# Line 165  void Event_post(Service_T service, long Line 165  void Event_post(Service_T service, long
165      {      {
166        /* Only first failed event can initialize the queue for given event type,        /* Only first failed event can initialize the queue for given event type,
167         * thus passed events are ignored until first error */         * thus passed events are ignored until first error */
168        if(!state)        if(state != STATE_FAILED)
169          return;          return;
170    
171        /* Event was not found in the pending events list, we will add it. */        /* Event was not found in the pending events list, we will add it. */
# Line 272  short Event_check_state(Event_T E, short Line 272  short Event_check_state(Event_T E, short
272    
273    ASSERT(E);    ASSERT(E);
274    
275      /* Only the true failed state condition can change the initial state */
276      if(S == STATE_PASSED && E->state == STATE_INIT)
277      {
278        return FALSE;
279      }
280    
281    action = (S == STATE_PASSED)?E->action->passed:E->action->failed;    action = (S == STATE_PASSED)?E->action->passed:E->action->failed;
282    
283    /* Compare as many bits as cycles able to trigger the action */    /* Compare as many bits as cycles able to trigger the action */

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.50

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26