summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-08-14 07:19:24 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-08-14 07:19:24 +0000
commit747f26cff23cbbd29ba2f5b349f4e559eac6feb4 (patch)
treeeffba81f5765ebccd5219c21f1a529f38d2eb34e
parentf93051c207fb6283c9cecdf3cab3309ff981fe6b (diff)
downloadzabbix-747f26cff23cbbd29ba2f5b349f4e559eac6feb4.tar.gz
zabbix-747f26cff23cbbd29ba2f5b349f4e559eac6feb4.tar.xz
zabbix-747f26cff23cbbd29ba2f5b349f4e559eac6feb4.zip
- [DEV-202] Unable to compile 1.5.3 on Solaris
git-svn-id: svn://svn.zabbix.com/trunk@5906 97f52cf1-0a1b-0410-bd0e-c28be96e8082
-rw-r--r--configure.in2
-rw-r--r--include/sysinc.h4
-rw-r--r--src/libs/zbxconf/cfg.c13
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 <sys/types.h>
#endif
+#ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+#endif
+
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#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 <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
-*/
+
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;
}