Permalink
Browse files

made simple test work, however...

this set of functions looks at a file systems as a disk-based one, not as one that could be dynamically
build and managed like those provided by QNX resource managers.  So, this is a fragile fix.  If a user
needs more, they'll have to fix/write themselves.  But the source is available!
  • Loading branch information...
1 parent b38673c commit c0d0289e104662a4d26f2f6ce0da922a03ac5f46 Ron Pfeifle committed Jun 20, 2012
Showing with 18 additions and 2 deletions.
  1. +18 −2 modules/contrib/src/inputoutput.cpp
View
20 modules/contrib/src/inputoutput.cpp
@@ -51,6 +51,14 @@ namespace cv
return list;
}
+ #ifdef __QNX__
+ // you have to ask QNX to please include more file information
+ // and not to report duplicate names as a result of file system unions
+ if ( -1 == dircntl(dp, D_SETFLAG, D_FLAG_STAT|D_FLAG_FILTER) ) {
+ return list;
+ }
+ #endif
+
while ((dirp = readdir(dp)) != NULL)
{
#ifdef __QNX__
@@ -62,7 +70,7 @@ namespace cv
_DEXTRA_VALID(extra, dirp);
extra = _DEXTRA_NEXT(extra),
extra_stat = reinterpret_cast<dirent_extra_stat *>(extra))
- if (extra->d_type == _DTYPE_STAT && S_ISREG(extra_stat->d_stat.st_mode))
+ if ((extra->d_type != _DTYPE_NONE) && S_ISREG(extra_stat->d_stat.st_mode))
#else
if (dirp->d_type == DT_REG)
#endif
@@ -120,6 +128,14 @@ namespace cv
return list;
}
+ #ifdef __QNX__
+ // you have to ask QNX to please include more file information
+ // and not to report duplicate names as a result of file system unions
+ if ( -1 == dircntl(dp, D_SETFLAG, D_FLAG_STAT|D_FLAG_FILTER) ) {
+ return list;
+ }
+ #endif
+
while ((dirp = readdir(dp)) != NULL)
{
#ifdef __QNX__
@@ -131,7 +147,7 @@ namespace cv
_DEXTRA_VALID(extra, dirp);
extra = _DEXTRA_NEXT(extra),
extra_stat = reinterpret_cast<dirent_extra_stat *>(extra))
- if (extra->d_type == _DTYPE_STAT &&
+ if ((extra->d_type != _DTYPE_NONE) &&
S_ISDIR(extra_stat->d_stat.st_mode) &&
#else
if (dirp->d_type == DT_DIR &&

0 comments on commit c0d0289

Please sign in to comment.