315 |
|
|
316 |
static void handle_resource(Event_T E) { |
static void handle_resource(Event_T E) { |
317 |
|
|
318 |
|
Device_T d; |
319 |
Resource_T r; |
Resource_T r; |
320 |
Service_T s= E->source; |
Service_T s= E->source; |
321 |
|
|
322 |
/* Check for executables to run */ |
for(d= s->devicelist; d; d= d->next) { |
323 |
|
if(d->event_flag && d->exec != NULL) { |
324 |
|
d->event_flag= FALSE; |
325 |
|
spawn(s, d->exec, EVENT_DESCRIPTION(E)); |
326 |
|
} |
327 |
|
} |
328 |
|
|
329 |
for(r= s->resourcelist; r; r= r->next) { |
for(r= s->resourcelist; r; r= r->next) { |
330 |
if(r->event_flag && r->exec != NULL) { |
if(r->event_flag && r->exec != NULL) { |
331 |
/* Reset the event_flag so the command is not executed again |
/* Reset the event_flag so the command is not executed again |