mirror of https://github.com/wolfSSL/wolfssh.git
fix for DIR with QNX
parent
67878bbec2
commit
fb0d3ba3d1
|
@ -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])
|
||||
|
|
Loading…
Reference in New Issue