[Nagiosplug-checkins] CVS: nagiosplug/plugins check_procs.c,1.6,1.7

Ton Voon tonvoon at users.sourceforge.net
Tue Jan 28 20:12:06 CET 2003


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

Modified Files:
	check_procs.c 
Log Message:
Fixed NULL status in Solaris (644783 - Fabian Pehla)
Fixed -p options (652082 - Ton Voon)


Index: check_procs.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_procs.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** check_procs.c	13 Jan 2003 12:15:16 -0000	1.6
--- check_procs.c	29 Jan 2003 04:11:49 -0000	1.7
***************
*** 73,80 ****
  int uid;
  int ppid;
! char *statopts = NULL;
! char *prog = NULL;
! char *args = NULL;
! char *fmt = NULL;
  char tmp[MAX_INPUT_BUFFER];
  
--- 73,80 ----
  int uid;
  int ppid;
! char *statopts = "";
! char *prog = "";
! char *args = "";
! char *fmt = "";
  char tmp[MAX_INPUT_BUFFER];
  
***************
*** 276,281 ****
  #endif
  
- 	asprintf (&fmt, "");
- 
  	for (c = 1; c < argc; c++)
  		if (strcmp ("-to", argv[c]) == 0)
--- 276,279 ----
***************
*** 352,356 ****
  		case 'p':									/* process id */
  			if (sscanf (optarg, "%d%[^0-9]", &ppid, tmp) == 1) {
! 				asprintf (&fmt, "%s%sPPID = %d", (options ? ", " : ""), ppid);
  				options |= PPID;
  				break;
--- 350,354 ----
  		case 'p':									/* process id */
  			if (sscanf (optarg, "%d%[^0-9]", &ppid, tmp) == 1) {
! 				asprintf (&fmt, "%s%sPPID = %d", fmt, (options ? ", " : ""), ppid);
  				options |= PPID;
  				break;
***************
*** 388,392 ****
  			}
  			user = pw->pw_name;
! 			asprintf (&fmt, "%s%sUID = %d (%s)", (options ? ", " : ""), fmt,
  			          uid, user);
  			options |= USER;
--- 386,390 ----
  			}
  			user = pw->pw_name;
! 			asprintf (&fmt, "%s%sUID = %d (%s)", fmt, (options ? ", " : ""),
  			          uid, user);
  			options |= USER;





More information about the Commits mailing list