예제 #1
0
파일: gc.c 프로젝트: andreax79/monit
static void _gcpdl(Dependant_T *d) {

  ASSERT(d);

  if((*d)->next)
    _gcpdl(&(*d)->next);

  FREE((*d)->dependant);
  FREE(*d);

}
예제 #2
0
파일: gc.c 프로젝트: andreax79/monit
static void _gc_service(Service_T *s) {

  ASSERT(s&&*s);
  
  if((*s)->portlist)
    _gcppl(&(*s)->portlist);

  if((*s)->filesystemlist)
    _gcfilesystem(&(*s)->filesystemlist);

  if((*s)->icmplist)
    _gcicmp(&(*s)->icmplist);

  if((*s)->maillist)
    gc_mail_list(&(*s)->maillist);

  if((*s)->resourcelist)
    _gcpql(&(*s)->resourcelist);

  if((*s)->inf)
    _gc_inf(&(*s)->inf);
  
  if((*s)->timestamplist)
    _gcptl(&(*s)->timestamplist);

  if((*s)->actionratelist)
    _gcparl(&(*s)->actionratelist);

  if((*s)->sizelist)
    _gcso(&(*s)->sizelist);

  if((*s)->matchlist)
    _gcmatch(&(*s)->matchlist);

  if((*s)->checksum)
    _gcchecksum(&(*s)->checksum);

  if((*s)->perm)
    _gcperm(&(*s)->perm);

  if((*s)->uid)
    _gcuid(&(*s)->uid);

  if((*s)->gid)
    _gcgid(&(*s)->gid);

  if((*s)->dependantlist)
    _gcpdl(&(*s)->dependantlist);

  if((*s)->start)
    gccmd(&(*s)->start);

  if((*s)->stop)
    gccmd(&(*s)->stop);

  if((*s)->action_DATA)
    _gc_eventaction(&(*s)->action_DATA);
  
  if((*s)->action_EXEC)
    _gc_eventaction(&(*s)->action_EXEC);
  
  if((*s)->action_INVALID)
    _gc_eventaction(&(*s)->action_INVALID);
  
  if((*s)->action_NONEXIST)
    _gc_eventaction(&(*s)->action_NONEXIST);
  
  if((*s)->action_PID)
    _gc_eventaction(&(*s)->action_PID);
  
  if((*s)->action_PPID)
    _gc_eventaction(&(*s)->action_PPID);
  
  if((*s)->action_FSFLAG)
    _gc_eventaction(&(*s)->action_FSFLAG);
  
  if((*s)->action_MONIT_START)
    _gc_eventaction(&(*s)->action_MONIT_START);
  
  if((*s)->action_MONIT_STOP)
    _gc_eventaction(&(*s)->action_MONIT_STOP);
  
  if((*s)->action_MONIT_RELOAD)
    _gc_eventaction(&(*s)->action_MONIT_RELOAD);
  
  if((*s)->action_ACTION)
    _gc_eventaction(&(*s)->action_ACTION);
  
  if((*s)->eventlist)
    gc_event(&(*s)->eventlist);

  FREE((*s)->name);
  FREE((*s)->path);
  
  (*s)->next= NULL;

  FREE(*s);

}
예제 #3
0
파일: gc.c 프로젝트: AsydSolutions/monit
static void _gc_service(Service_T *s) {

        ASSERT(s&&*s);

        if ((*s)->program) {
                if ((*s)->program->P)
                        Process_free(&(*s)->program->P);
                if ((*s)->program->C)
                        Command_free(&(*s)->program->C);
                if ((*s)->program->args)
                        gccmd(&(*s)->program->args);
                StringBuffer_free(&((*s)->program->output));
                FREE((*s)->program);
        }

        if((*s)->portlist)
                _gcppl(&(*s)->portlist);

        if((*s)->filesystemlist)
                _gcfilesystem(&(*s)->filesystemlist);

        if((*s)->icmplist)
                _gcicmp(&(*s)->icmplist);

        if((*s)->maillist)
                gc_mail_list(&(*s)->maillist);

        if((*s)->resourcelist)
                _gcpql(&(*s)->resourcelist);

        if((*s)->inf)
                _gc_inf(&(*s)->inf);

        if((*s)->timestamplist)
                _gcptl(&(*s)->timestamplist);

        if((*s)->actionratelist)
                _gcparl(&(*s)->actionratelist);

        if((*s)->sizelist)
                _gcso(&(*s)->sizelist);

        if((*s)->matchlist)
                _gcmatch(&(*s)->matchlist);

        if((*s)->matchignorelist)
                _gcmatch(&(*s)->matchignorelist);

        if((*s)->checksum)
                _gcchecksum(&(*s)->checksum);

        if((*s)->perm)
                _gcperm(&(*s)->perm);

        if ((*s)->statuslist)
                _gcstatus(&(*s)->statuslist);

        if ((*s)->every.type == EVERY_CRON || (*s)->every.type == EVERY_NOTINCRON)
                FREE((*s)->every.spec.cron);

        if((*s)->uid)
                _gcuid(&(*s)->uid);

        if((*s)->euid)
                _gcuid(&(*s)->euid);

        if((*s)->gid)
                _gcgid(&(*s)->gid);

        if((*s)->pidlist)
                _gcpid(&(*s)->pidlist);

        if((*s)->ppidlist)
                _gcppid(&(*s)->ppidlist);

        if((*s)->dependantlist)
                _gcpdl(&(*s)->dependantlist);

        if((*s)->start)
                gccmd(&(*s)->start);

        if((*s)->stop)
                gccmd(&(*s)->stop);

        if((*s)->action_DATA)
                _gc_eventaction(&(*s)->action_DATA);

        if((*s)->action_EXEC)
                _gc_eventaction(&(*s)->action_EXEC);

        if((*s)->action_INVALID)
                _gc_eventaction(&(*s)->action_INVALID);

        if((*s)->action_NONEXIST)
                _gc_eventaction(&(*s)->action_NONEXIST);

        if((*s)->action_FSFLAG)
                _gc_eventaction(&(*s)->action_FSFLAG);

        if((*s)->action_MONIT_START)
                _gc_eventaction(&(*s)->action_MONIT_START);

        if((*s)->action_MONIT_STOP)
                _gc_eventaction(&(*s)->action_MONIT_STOP);

        if((*s)->action_MONIT_RELOAD)
                _gc_eventaction(&(*s)->action_MONIT_RELOAD);

        if((*s)->action_ACTION)
                _gc_eventaction(&(*s)->action_ACTION);

        if((*s)->eventlist)
                gc_event(&(*s)->eventlist);

        FREE((*s)->name);
        FREE((*s)->path);

        (*s)->next = NULL;

        FREE(*s);

}