From 4bd1f48f0bf1ad1703be680ec2a38d626c6a2668 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 30 Aug 2017 23:32:39 +0200 Subject: [PATCH] Compare file prefix only. This corrects commit e38b14311d3182de4c7bd3b03dcdde8caa93a941. --- src/smpi/internals/smpi_memory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() -- 2.20.1