Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Compare file prefix only.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 30 Aug 2017 21:32:39 +0000 (23:32 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 31 Aug 2017 09:29:09 +0000 (11:29 +0200)
This corrects commit e38b14311d3182de4c7bd3b03dcdde8caa93a941.

src/smpi/internals/smpi_memory.cpp

index 4fce186..d816b3c 100644 (file)
@@ -108,8 +108,8 @@ void smpi_really_switch_data_segment(int dest)
 
 int smpi_is_privatization_file(char* file)
 {
-  const std::string buffer_path {"/dev/shm/my-buffer-"};
-  return buffer_path.compare(file) == 0;
+  const std::string buffer_path("/dev/shm/my-buffer-");
+  return buffer_path.compare(0, std::string::npos, file, buffer_path.length()) == 0;
 }
 
 void smpi_initialize_global_memory_segments()