diff options
Diffstat (limited to 'src/libs/zbxsysinfo/netbsd/hostname.c')
-rw-r--r-- | src/libs/zbxsysinfo/netbsd/hostname.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libs/zbxsysinfo/netbsd/hostname.c b/src/libs/zbxsysinfo/netbsd/hostname.c index c0ccec5fc00..804b9a90050 100644 --- a/src/libs/zbxsysinfo/netbsd/hostname.c +++ b/src/libs/zbxsysinfo/netbsd/hostname.c @@ -18,6 +18,7 @@ **/ #include "sysinfo.h" +#include "log.h" #ifdef HAVE_SYS_UTSNAME_H # include <sys/utsname.h> @@ -32,7 +33,10 @@ int SYSTEM_HOSTNAME(AGENT_REQUEST *request, AGENT_RESULT *result) struct utsname name; if (-1 == uname(&name)) + { + SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Cannot obtain system information: %s", zbx_strerror(errno))); return SYSINFO_RET_FAIL; + } SET_STR_RESULT(result, zbx_strdup(NULL, name.nodename)); |