diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-07-13 08:54:57 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-07-13 08:54:57 +0000 |
commit | 6b9cc76d0a27631fbab19a31ab8bd46e143b7580 (patch) | |
tree | 7153d03691decf028fa422dac86d3aec46908f54 /plugins | |
parent | a46e358d68027289cffaffeb7a4b32ababb2105b (diff) | |
download | monitoring-plugins-6b9cc76d0a27631fbab19a31ab8bd46e143b7580.tar.gz |
Using coreutils' base_name function because of portability issues with
Tru64
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1450 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_procs.c | 2 | ||||
-rw-r--r-- | plugins/utils.c | 27 | ||||
-rw-r--r-- | plugins/utils.h | 3 |
3 files changed, 1 insertions, 31 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c index f6438f27..82a21eb2 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c @@ -189,7 +189,7 @@ main (int argc, char **argv) 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); diff --git a/plugins/utils.c b/plugins/utils.c index a455f225..cb013412 100644 --- a/plugins/utils.c +++ b/plugins/utils.c @@ -640,33 +640,6 @@ strpcat (char *dest, const char *src, const char *str) 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 diff --git a/plugins/utils.h b/plugins/utils.h index ed6243df..4bbe33d0 100644 --- a/plugins/utils.h +++ b/plugins/utils.h @@ -80,9 +80,6 @@ void set_thresholds(thresholds **, char *, char *); 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 |