[Nagiosplug-checkins] nagiosplug/plugins check_procs.c, 1.51, 1.52 utils.c, 1.48, 1.49 utils.h, 1.29, 1.30

Ton Voon tonvoon at users.sourceforge.net
Thu Jul 13 10:54:59 CEST 2006


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3873/plugins

Modified Files:
	check_procs.c utils.c utils.h 
Log Message:
Using coreutils' base_name function because of portability issues with
Tru64


Index: check_procs.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_procs.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- check_procs.c	20 Jun 2006 11:17:02 -0000	1.51
+++ check_procs.c	13 Jul 2006 08:54:57 -0000	1.52
@@ -189,7 +189,7 @@
 			strip (procargs);
 
 			/* Some ps return full pathname for command. This removes path */
-			procprog = basename(procprog);
+			procprog = base_name(procprog);
 
 			/* we need to convert the elapsed time to seconds */
 			procseconds = convert_to_seconds(procetime);

Index: utils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- utils.c	18 Jun 2006 19:36:48 -0000	1.48
+++ utils.c	13 Jul 2006 08:54:57 -0000	1.49
@@ -640,33 +640,6 @@
 	return dest;
 }
 
-#ifndef HAVE_BASENAME
-/* function modified from coreutils base_name function - see ACKNOWLEDGEMENTS */
-char *basename(const char *path) {
-	char const *base = path;
-	char const *p;
-	for (p = base; *p; p++) {
-		if (*p == '/') {
-			/* Treat multiple adjacent slashes like single slash */
-			do p++;
-			while (*p == '/');
-
-			/* If filename ends in slash, use trailing slash
-			   as basename if no non-slashes found */
-			if (! *p) {
-				if (*base == '/')
-					base = p - 1;
-				break;
-			}
-
-			/* *p is non-slash preceded by slash */
-			base = p;
-		}
-	}
-	return (char *) base;
-}
-#endif
-
 /******************************************************************************
  *
  * Print perfdata in a standard format

Index: utils.h
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/utils.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- utils.h	27 Apr 2006 13:25:09 -0000	1.29
+++ utils.h	13 Jul 2006 08:54:57 -0000	1.30
@@ -80,9 +80,6 @@
 int check_range(double, range *);
 int get_status(double, thresholds *);
 
-/* I think this needs to be defined even if you use the system version */
-char *basename(const char *path);
-
 #ifndef HAVE_GETTIMEOFDAY
 int gettimeofday(struct timeval *, struct timezone *);
 #endif





More information about the Commits mailing list