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

Diff of /monit/util.c

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

revision 1.39 by chopp, Sat Nov 2 10:47:22 2002 UTC revision 1.40 by hauk, Sun Nov 3 08:14:40 2002 UTC
# Line 144  void chomp(char *string) { Line 144  void chomp(char *string) {
144        
145    char *p;    char *p;
146    
147    ASSERT(chomp);    ASSERT(string);
148    
149    if ((p= strchr(string, '\r'))   ||    if ((p= strchr(string, '\r'))   ||
150         (p= strchr(string, '\n'))) {         (p= strchr(string, '\n'))) {
# Line 430  void printprocess(Process_T p) { Line 430  void printprocess(Process_T p) {
430    Mail_T r;    Mail_T r;
431    Resource_T q;    Resource_T q;
432    Checksum_T c;    Checksum_T c;
433    
434      ASSERT(p);
435    
436    printf("%-21s = %s\n", "Process Name", p->name);    printf("%-21s = %s\n", "Process Name", p->name);
437    printf(" %-20s = %s\n", "Group", is_str_defined(p->group));    printf(" %-20s = %s\n", "Group", is_str_defined(p->group));
# Line 462  void printprocess(Process_T p) { Line 464  void printprocess(Process_T p) {
464        if ( n->family == AF_INET ) {        if ( n->family == AF_INET ) {
465    
466          printf(" %-20s = %s:%d%s [protocol %s]\n", "Host:Port",          printf(" %-20s = %s:%d%s [protocol %s]\n", "Host:Port",
467                 n->hostname, n->port, n->request?n->request:"", n->protocol->name);                 n->hostname, n->port, n->request?n->request:"",
468                   n->protocol->name);
469        } else if ( n->family == AF_UNIX ) {        } else if ( n->family == AF_UNIX ) {
470    
471          printf(" %-20s = %s [protocol %s]\n", "Unix Socket",          printf(" %-20s = %s [protocol %s]\n", "Unix Socket",
# Line 666  int is_process_running(Process_T p) { Line 669  int is_process_running(Process_T p) {
669    pid_t  pid;    pid_t  pid;
670    int kill_return= 0;    int kill_return= 0;
671    
672      ASSERT(p);
673      
674    errno= 0;    errno= 0;
675    
676    if ((pid= get_pid(p->pidfile))) {    if ((pid= get_pid(p->pidfile))) {
# Line 721  char *get_RFC1123date(long *date) { Line 726  char *get_RFC1123date(long *date) {
726    }    }
727    
728    return xstrdup(D);    return xstrdup(D);
729      
730  }  }
731    
732    
# Line 818  char *get_uptime(time_t delta) { Line 824  char *get_uptime(time_t delta) {
824  int set_md5sum(char **dest, char *file) {  int set_md5sum(char **dest, char *file) {
825    
826    ASSERT(dest);    ASSERT(dest);
   ASSERT(*dest);  
827    ASSERT(file);    ASSERT(file);
828    
829    if (! (*dest= get_md5sum(file))) {    if (! (*dest= get_md5sum(file))) {

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40

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