[nagiosplug] check_procs: Get rid of HAVE_PROC_PID_EXE
"Nagios Plugin Development" <[email protected]> Sun, 18 Aug 2013 11:10:21 +0000
| Newsgroups | gmane.network.nagios.plugins.cvs |
|---|---|
| Message-ID | <[email protected]> |
Module: nagiosplug
Branch: master
Commit: 0f686d436e5e18d6f40fecc01128d3f383439b35
Author: Sebastian Schmidt <[email protected]>
Committer: Holger Weiss <[email protected]>
Date: Sun Aug 18 12:42:11 2013 +0200
URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=0f686d4
check_procs: Get rid of HAVE_PROC_PID_EXE
Don't check for /proc/pid/exe at compile time, it could be gone in a
build chroot or the like. Checking at runtime (once) is sufficient.
---
configure.in | 6 ------
plugins/check_procs.c | 2 +-
2 files changed, 1 insertions(+), 7 deletions(-)
diff --git a/configure.in b/configure.in
index 7efcb0f..43fe4ad 100644
--- a/configure.in
+++ b/configure.in
@@ -1632,12 +1632,6 @@ if test -n "$ac_cv_proc_meminfo"; then
EXTRAS="$EXTRAS check_swap"
fi
-AC_MSG_CHECKING([for /proc/pid/exe])
-if [readlink /proc/$$/exe > /dev/null 2>&1]; then
- AC_MSG_RESULT([found])
- AC_DEFINE(HAVE_PROC_PID_EXE,1,[Define if we have /proc/pid/exe])
-fi
-
AC_PATH_PROG(PATH_TO_DIG,dig)
AC_ARG_WITH(dig_command,
ACX_HELP_STRING([--with-dig-command=PATH],
diff --git a/plugins/check_procs.c b/plugins/check_procs.c
index d6441f0..3b4c822 100644
--- a/plugins/check_procs.c
+++ b/plugins/check_procs.c
@@ -110,7 +110,7 @@ FILE *ps_input = NULL;
static int
stat_exe (const pid_t pid, struct_stat_t *buf) {
-#if defined(HAVE_PROC_PID_EXE) && defined(HAVE_SYS_STAT_H)
+#ifdef HAVE_SYS_STAT_H
char *path;
int ret;
xasprintf(&path, "/proc/%d/exe", pid);
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk