/[monit]/monit/process/sysdep.c
ViewVC logotype

Diff of /monit/process/sysdep.c

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

revision 1.4 by rory, Wed Sep 11 23:00:09 2002 UTC revision 1.5 by hauk, Fri Sep 13 01:32:26 2002 UTC
# Line 100  Line 100 
100    
101  int init_process_info_sysdep(void) {  int init_process_info_sysdep(void) {
102    
103    if( getuid()!=0 ) {    return (getuid()==0);
   
     error("%s: You must run monit as root to utilize the "  
           "process status functionality.\n", prog);  
     return FALSE;  
   
   }  
   
   return TRUE;  
104    
105  }  }
106    
# Line 357  int init_process_info_sysdep(void) { Line 349  int init_process_info_sysdep(void) {
349    
350    register int pagesize;    register int pagesize;
351    struct vmmeter vmm;    struct vmmeter vmm;
352      
353    struct nlist nlst [] = {    struct nlist nlst [] = {
354      { "_bufspace"},        { "_bufspace"},
355      { "_cnt" },        { "_cnt" },
356      { 0 }        { 0 }
357    };    };
358    
359    kvm_handle = kvm_open(NULL, NULL, NULL, O_RDONLY, "monit");    if(getuid()!=0) {
   
   if ( kvm_handle == NULL ) {  
360    
361      return FALSE;      return FALSE;
362    
363    }    }
364    
365      kvm_handle = kvm_open(NULL, NULL, NULL, O_RDONLY, "monit");
366      
367      if ( kvm_handle == NULL ) {
368        
369        return FALSE;
370        
371      }
372      
373    /* ----------------------------- INIT MEM -----------------------------*/    /* ----------------------------- INIT MEM -----------------------------*/
374    /* Got it from libgtop/sysdep/freebsd/mem.c */    /* Got it from libgtop/sysdep/freebsd/mem.c */
375    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

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