From 747f26cff23cbbd29ba2f5b349f4e559eac6feb4 Mon Sep 17 00:00:00 2001 From: sasha Date: Thu, 14 Aug 2008 07:19:24 +0000 Subject: - [DEV-202] Unable to compile 1.5.3 on Solaris git-svn-id: svn://svn.zabbix.com/trunk@5906 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- configure.in | 2 +- include/sysinc.h | 4 ++++ src/libs/zbxconf/cfg.c | 13 +++++-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index c4381755..2e3ec868 100644 --- a/configure.in +++ b/configure.in @@ -38,7 +38,7 @@ dnl AM_PROG_LIBTOOL dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(stdio.h stdlib.h string.h unistd.h netdb.h signal.h \ - syslog.h time.h errno.h sys/types.h sys/stat.h netinet/in.h \ + syslog.h time.h errno.h sys/types.h sys/dir.h sys/stat.h netinet/in.h \ math.h sys/socket.h dirent.h ctype.h \ mtent.h fcntl.h sys/param.h sys/mount.h arpa/inet.h \ sys/vfs.h sys/pstat.h sys/sysinfo.h sys/statvfs.h \ diff --git a/include/sysinc.h b/include/sysinc.h index e58b0463..7bbabd8c 100644 --- a/include/sysinc.h +++ b/include/sysinc.h @@ -81,6 +81,10 @@ # include #endif +#ifdef HAVE_SYS_DIR_H +# include +#endif + #ifdef HAVE_INTTYPES_H # include #endif diff --git a/src/libs/zbxconf/cfg.c b/src/libs/zbxconf/cfg.c index 4b09281e..cc5a7821 100644 --- a/src/libs/zbxconf/cfg.c +++ b/src/libs/zbxconf/cfg.c @@ -20,16 +20,10 @@ #include "common.h" #include "cfg.h" #include "log.h" -/* -#include -#include -#include -#include -*/ + char *CONFIG_FILE = NULL; int CONFIG_ZABBIX_FORKS = 5; - char *CONFIG_LOG_FILE = NULL; int CONFIG_LOG_FILE_SIZE = 1; char CONFIG_ALLOW_ROOT = 0; @@ -59,7 +53,10 @@ static int parse_cfg_object(const char *cfg_file, struct cfg_line *cfg) while (NULL != (d = readdir(dir))) { incl_file = zbx_dsprintf(incl_file, "%s/%s", cfg_file, d->d_name); - if (d->d_type == DT_REG && parse_cfg_file(incl_file, cfg) == FAIL) { + if (stat(incl_file, &sb) == -1 || !S_ISREG(sb.st_mode)) + continue; + + if (parse_cfg_file(incl_file, cfg) == FAIL) { result = FAIL; break; } -- cgit