From: Arnaud Giersch Date: Wed, 30 Aug 2017 21:32:39 +0000 (+0200) Subject: Compare file prefix only. X-Git-Tag: v3_17~177 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/4bd1f48f0bf1ad1703be680ec2a38d626c6a2668 Compare file prefix only. This corrects commit e38b14311d3182de4c7bd3b03dcdde8caa93a941. --- diff --git a/src/smpi/internals/smpi_memory.cpp b/src/smpi/internals/smpi_memory.cpp index 4fce186361..d816b3c653 100644 --- a/src/smpi/internals/smpi_memory.cpp +++ b/src/smpi/internals/smpi_memory.cpp @@ -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()