goiri commented on a change in pull request #2792:
URL: https://github.com/apache/hadoop/pull/2792#discussion_r599761580



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/fs/filesystem.cc
##########
@@ -722,16 +722,16 @@ void FileSystemImpl::FindShim(const Status &stat, const 
std::vector<StatInfo> &
       for (StatInfo const& si : stat_infos) {
         //If we are at the last depth and it matches both path and name, we 
need to output it.
         if (operational_state->depth == shared_state->dirs.size() - 2
-            && !fnmatch(shared_state->dirs[operational_state->depth + 
1].c_str(), si.path.c_str(), 0)
-            && !fnmatch(shared_state->name.c_str(), si.path.c_str(), 0)) {
+            && 
XPlatform::Syscall::FnMatch(shared_state->dirs[operational_state->depth + 1], 
si.path)
+            && XPlatform::Syscall::FnMatch(shared_state->name, si.path)) {
           outputs.push_back(si);
         }
         //Skip if not directory
         if(si.file_type != StatInfo::IS_DIR) {
           continue;
         }
         //Checking for a match with the path at the current depth
-        if(!fnmatch(shared_state->dirs[operational_state->depth + 1].c_str(), 
si.path.c_str(), 0)){
+        
if(XPlatform::Syscall::FnMatch(shared_state->dirs[operational_state->depth + 
1], si.path)) {

Review comment:
       XPlatform::Syscall::FnMatch is equivalent to !fnmatch?
   I have to say that the original was a little antiintuitive.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to