summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-10-06 11:28:05 +0000
committerhugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2005-10-06 11:28:05 +0000
commit0caa85b15425ffa707deb78edaddbefeed02e4bf (patch)
tree65b59913dcd011ca255a86bad4a24bf05d945a57
parent000e87fbe9f1d11a5e3eae76a13fb8ab94ca683d (diff)
- fixed compilation of hstrerror() under misc platforms (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@2127 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r--ChangeLog1
-rw-r--r--configure.in1
-rw-r--r--src/zabbix_agent/active.c5
-rw-r--r--src/zabbix_server/poller/checks_agent.c5
4 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index c1c0d731..d25867eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
Changes for 1.1beta2:
+ - fixed compilation of hstrerror() under misc platforms (Alexei)
- fixed compilation issues of Unix agent on non-Linux platforms (Alexei)
- added support of autoregistration of new hosts (Alexei)
- fixed "Add items from template" functionality (Alexei)
diff --git a/configure.in b/configure.in
index 4ce46250..fed92a77 100644
--- a/configure.in
+++ b/configure.in
@@ -451,6 +451,7 @@ AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(vasprintf)
AC_CHECK_FUNCS(asprintf)
AC_CHECK_FUNCS(vsnprintf)
+AC_CHECK_FUNCS(hstrerror)
dnl Check if we want to compile everything with static
AC_ARG_ENABLE(static,[
diff --git a/src/zabbix_agent/active.c b/src/zabbix_agent/active.c
index e116c94b..38372b60 100644
--- a/src/zabbix_agent/active.c
+++ b/src/zabbix_agent/active.c
@@ -196,8 +196,13 @@ int get_active_checks(char *server, int port, char *error, int max_error_len)
if(hp==NULL)
{
+#ifdef HAVE_HSTRERROR
zabbix_log( LOG_LEVEL_WARNING, "gethostbyname() failed [%s]", hstrerror(h_errno));
snprintf(error,max_error_len-1,"gethostbyname() failed [%s]", hstrerror(h_errno));
+#else
+ zabbix_log( LOG_LEVEL_WARNING, "gethostbyname() failed [%d]", h_errno);
+ snprintf(error,max_error_len-1,"gethostbyname() failed [%d]", h_errno);
+#endif
return NETWORK_ERROR;
}
diff --git a/src/zabbix_server/poller/checks_agent.c b/src/zabbix_server/poller/checks_agent.c
index 07d653d3..2303db7b 100644
--- a/src/zabbix_server/poller/checks_agent.c
+++ b/src/zabbix_server/poller/checks_agent.c
@@ -66,8 +66,13 @@ int get_value_agent(double *result,char *result_str,DB_ITEM *item,char *error,in
if(hp==NULL)
{
+#ifdef HAVE_HSTRERROR
zabbix_log( LOG_LEVEL_WARNING, "gethostbyname() failed [%s]", hstrerror(h_errno));
snprintf(error,max_error_len-1,"gethostbyname() failed [%s]", hstrerror(h_errno));
+#else
+ zabbix_log( LOG_LEVEL_WARNING, "gethostbyname() failed [%d]", h_errno);
+ snprintf(error,max_error_len-1,"gethostbyname() failed [%d]", h_errno);
+#endif
return NETWORK_ERROR;
}