diff --git a/src/source-pcap-file-directory-helper.c b/src/source-pcap-file-directory-helper.c index bd244fbc56..b2da74441e 100644 --- a/src/source-pcap-file-directory-helper.c +++ b/src/source-pcap-file-directory-helper.c @@ -304,7 +304,7 @@ TmEcode PcapDirectoryPopulateBuffer(PcapFileDirectoryVars *pv, PendingFile *file_to_add = NULL; while ((dir = readdir(pv->directory)) != NULL) { -#ifndef OS_WIN32 +#if defined(DT_REG) if (dir->d_type != DT_REG) { continue; } diff --git a/src/util-path.c b/src/util-path.c index d7618856e4..072133c04b 100644 --- a/src/util-path.c +++ b/src/util-path.c @@ -196,7 +196,7 @@ bool SCPathExists(const char *path) */ bool SCIsRegularDirectory(const struct dirent *const dir_entry) { -#ifndef OS_WIN32 +#if !defined(OS_WIN32) && !defined(__sun) if ((dir_entry->d_type == DT_DIR) && (strcmp(dir_entry->d_name, ".") != 0) && (strcmp(dir_entry->d_name, "..") != 0)) { @@ -214,7 +214,7 @@ bool SCIsRegularDirectory(const struct dirent *const dir_entry) */ bool SCIsRegularFile(const struct dirent *const dir_entry) { -#ifndef OS_WIN32 +#if defined(DT_REG) return dir_entry->d_type == DT_REG; #endif return false;