fix for DIR with QNX

pull/449/head
JacobBarthelmeh 2022-08-25 15:32:07 -07:00
parent 67878bbec2
commit fb0d3ba3d1
1 changed files with 17 additions and 2 deletions

View File

@ -47,6 +47,7 @@
#endif
#include "configuration.h"
#include <dirent.h>
struct WOLFSSHD_CONFIG {
void* heap;
@ -533,7 +534,14 @@ static int HandleInclude(WOLFSSHD_CONFIG *conf, const char *value)
/* Count up the number of files */
while ((dir = WREADDIR(&d)) != NULL) {
/* Skip sub-directories */
if (dir->d_type != DT_DIR) {
#if defined(__QNX__) || defined(__QNXNTO__)
struct stat s;
lstat(dir->d_name, &s);
if (!S_ISDIR(s.st_mode))
#else
if (dir->d_type != DT_DIR)
#endif
fileCount++;
}
}
@ -551,7 +559,14 @@ static int HandleInclude(WOLFSSHD_CONFIG *conf, const char *value)
i = 0;
while (i < fileCount && (dir = WREADDIR(&d)) != NULL) {
/* Skip sub-directories */
if (dir->d_type != DT_DIR) {
#if defined(__QNX__) || defined(__QNXNTO__)
struct stat s;
lstat(dir->d_name, &s);
if (!S_ISDIR(s.st_mode))
#else
if (dir->d_type != DT_DIR)
#endif
/* Insert in string order */
for (j = 0; j < i; j++) {
if (WSTRCMP(dir->d_name, fileNames[j])