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



##########
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?
   
   Yes. fnmatch returns 0 on a successful match.




-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to