[Sysfence-commit] sysfence mainloop.c,1.9,1.10
Status: Alpha
Brought to you by:
emes
|
From: mkoperto <mko...@us...> - 2004-05-24 22:25:26
|
Update of /cvsroot/sysfence/sysfence In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4438 Modified Files: mainloop.c Log Message: + processes titles Index: mainloop.c =================================================================== RCS file: /cvsroot/sysfence/sysfence/mainloop.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- mainloop.c 23 May 2004 20:52:22 -0000 1.9 +++ mainloop.c 24 May 2004 22:25:16 -0000 1.10 @@ -24,6 +24,7 @@ #include "log.h" #include "communication.h" #include "mainloop.h" +#include "processtitle.h" int step = 10; @@ -33,7 +34,7 @@ /* save result of this and previous hit */ rule->prevhit = rule->hit; - /* set semaphore while checking data */ + /* set semaphore while checking data */ semaphore_wait (semid); rule->hit = check_expression (rule->expr); semaphore_post (semid); @@ -55,7 +56,9 @@ /* second - run command */ if (rule->run != NULL) { if (! (rule->run->once && rule->prevhit)) { + setproctitle (RULE_PROCESS, STATE_EXEC, rule->name); system (rule->run->command); + setproctitle (RULE_PROCESS, STATE_NORMAL, rule->name); #ifdef DEBUG printf ("executed '%s'\n", rule->run->command); #endif |