[Nagiosplug-checkins] CVS: nagiosplug/plugins check_procs.c,1.15,1.16

Ton Voon tonvoon at users.sourceforge.net
Thu Jul 3 09:50:07 CEST 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv6757

Modified Files:
	check_procs.c 
Log Message:
Fixed seg fault on some Sol 7/8 servers (Patch 764745 - Alexander Matey)


Index: check_procs.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_procs.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** check_procs.c	11 Apr 2003 23:47:39 -0000	1.15
--- check_procs.c	3 Jul 2003 16:49:14 -0000	1.16
***************
*** 205,213 ****
  		if ( cols == 6 && strstr(procstat, zombie) ) {
  			cols = 7;
  		}
  		if ( cols >= 7 ) {
  			resultsum = 0;
  			asprintf (&procargs, "%s", input_buffer + pos);
!  			strip (procargs);
  
  			if ((options & STAT) && (strstr (statopts, procstat)))
--- 205,217 ----
  		if ( cols == 6 && strstr(procstat, zombie) ) {
  			cols = 7;
+ 			/* Set some value for procargs for the strip command further below 
+ 			Seen to be a problem on some Solaris 7 and 8 systems */
+ 			input_buffer[pos] = '\n';
+ 			input_buffer[pos+1] = 0x0;
  		}
  		if ( cols >= 7 ) {
  			resultsum = 0;
  			asprintf (&procargs, "%s", input_buffer + pos);
! 			strip (procargs);
  
  			if ((options & STAT) && (strstr (statopts, procstat)))





More information about the Commits mailing list