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

Diff of /monit/gc.c

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

revision 1.25 by hauk, Mon Aug 4 07:52:11 2003 UTC revision 1.26 by martinp, Wed Aug 6 14:51:12 2003 UTC
# Line 30  Line 30 
30  /* Private prototypes */  /* Private prototypes */
31  static void _gcppl(Port_T *);  static void _gcppl(Port_T *);
32  static void _gcpl(Service_T *);  static void _gcpl(Service_T *);
 static void _gcpcl(Checksum_T *);  
33  static void _gcpql(Resource_T *);  static void _gcpql(Resource_T *);
34  static void _gcppil(ProcInfo_T *);  static void _gcppil(ProcInfo_T *);
35  static void _gcptl(Timestamp_T *);  static void _gcptl(Timestamp_T *);
# Line 72  void gc_service(Service_T *s) { Line 71  void gc_service(Service_T *s) {
71      _gcppl(&(*s)->portlist);      _gcppl(&(*s)->portlist);
72    }    }
73    
   if((*s)->checksumlist) {  
     _gcpcl(&(*s)->checksumlist);  
   }  
   
74    if((*s)->maillist) {    if((*s)->maillist) {
75      gc_mail_list(&(*s)->maillist);      gc_mail_list(&(*s)->maillist);
76    }    }
# Line 104  void gc_service(Service_T *s) { Line 99  void gc_service(Service_T *s) {
99      _gcpdl(&(*s)->dependantlist);      _gcpdl(&(*s)->dependantlist);
100    }    }
101    
   free((*s)->name);  
   free((*s)->path);  
   free((*s)->group);  
     
102    if((*s)->start) {    if((*s)->start) {
103      _gccmd(&(*s)->start);      _gccmd(&(*s)->start);
104    }    }
# Line 116  void gc_service(Service_T *s) { Line 107  void gc_service(Service_T *s) {
107      _gccmd(&(*s)->stop);      _gccmd(&(*s)->stop);
108    }    }
109        
110      free((*s)->name);
111      free((*s)->path);
112      free((*s)->group);
113      free((*s)->md5);
114      
115    (*s)->next= NULL;    (*s)->next= NULL;
116    
117    pthread_mutex_destroy(&(*s)->mutex);    pthread_mutex_destroy(&(*s)->mutex);
# Line 200  static void _gcppl(Port_T *p) { Line 196  static void _gcppl(Port_T *p) {
196  }  }
197    
198    
 static void _gcpcl(Checksum_T *s) {  
     
   ASSERT(s&&*s);  
   
   if((*s)->next) {  
     _gcpcl(&(*s)->next);  
   }  
   
   free((*s)->file);  
   free((*s)->md5);  
   free(*s);  
   *s= NULL;  
   
 }  
   
   
199  static void _gcpql(Resource_T *q) {  static void _gcpql(Resource_T *q) {
200    
201    ASSERT(q);    ASSERT(q);
# Line 262  static void _gcptl(Timestamp_T *p) { Line 242  static void _gcptl(Timestamp_T *p) {
242      _gcptl(&(*p)->next);      _gcptl(&(*p)->next);
243    }    }
244    
   free((*p)->pathname);  
245    if((*p)->exec) {    if((*p)->exec) {
246      _gccmd(&(*p)->exec);      _gccmd(&(*p)->exec);
247    }    }

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

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