Skip to content

Commit 262ef02

Browse files
author
Clement Champetier
committed
profile/util: clean getFilesInDir
1 parent 4b7972a commit 262ef02

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/AvTranscoder/profile/util.hpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,6 @@ int getFilesInDir( const std::string& dir, std::vector< std::string >& files )
4949
WIN32_FIND_DATA findData;
5050
HANDLE findHandle;
5151

52-
#else
53-
DIR *dp;
54-
struct dirent *dirp;
55-
if( ( dp = opendir( dir.c_str() ) ) == NULL )
56-
{
57-
std::cerr << "Error(" << errno << ") opening " << dir << std::endl;
58-
return errno;
59-
}
60-
#endif
61-
62-
#if defined ( __WINDOWS__ )
6352
findHandle = FindFirstFile( ( dir + "\\*" ).c_str(), &findData );
6453
if( findHandle == INVALID_HANDLE_VALUE )
6554
{
@@ -78,6 +67,14 @@ int getFilesInDir( const std::string& dir, std::vector< std::string >& files )
7867
}
7968

8069
#else
70+
DIR *dp;
71+
struct dirent *dirp;
72+
if( ( dp = opendir( dir.c_str() ) ) == NULL )
73+
{
74+
std::cerr << "Error(" << errno << ") opening " << dir << std::endl;
75+
return errno;
76+
}
77+
8178
while( ( dirp = readdir( dp ) ) != NULL )
8279
{
8380
const std::string filename( dirp->d_name );

0 commit comments

Comments
 (0)