diff --git a/src/cpp/rtps/DataSharing/DataSharingNotification.cpp b/src/cpp/rtps/DataSharing/DataSharingNotification.cpp index be7bbfaee8b..7bbdd841d0b 100644 --- a/src/cpp/rtps/DataSharing/DataSharingNotification.cpp +++ b/src/cpp/rtps/DataSharing/DataSharingNotification.cpp @@ -54,16 +54,32 @@ bool DataSharingNotification::create_and_init_notification( const GUID_t& reader_guid, const std::string& shared_dir) { - return create_and_init_shared_segment_notification(reader_guid, - shared_dir); + if (shared_dir.empty()) + { + return create_and_init_shared_segment_notification(reader_guid, + shared_dir); + } + else + { + return create_and_init_shared_segment_notification(reader_guid, + shared_dir); + } } bool DataSharingNotification::open_and_init_notification( const GUID_t& reader_guid, const std::string& shared_dir) { - return open_and_init_shared_segment_notification(reader_guid, - shared_dir); + if (shared_dir.empty()) + { + return open_and_init_shared_segment_notification(reader_guid, + shared_dir); + } + else + { + return open_and_init_shared_segment_notification(reader_guid, + shared_dir); + } } void DataSharingNotification::destroy() diff --git a/src/cpp/rtps/DataSharing/DataSharingNotification.hpp b/src/cpp/rtps/DataSharing/DataSharingNotification.hpp index fe5c6e38309..e8b94ebd585 100644 --- a/src/cpp/rtps/DataSharing/DataSharingNotification.hpp +++ b/src/cpp/rtps/DataSharing/DataSharingNotification.hpp @@ -152,7 +152,7 @@ class DataSharingNotification catch (const std::exception& e) { logError(HISTORY_DATASHARING_LISTENER, "Failed to create segment " << segment_name_ - << ": " << e.what()); + << ": " << e.what()); return false; } @@ -167,7 +167,7 @@ class DataSharingNotification T::remove(segment_name_); logError(HISTORY_DATASHARING_LISTENER, "Failed to create listener queue " << segment_name_ - << ": " << e.what()); + << ": " << e.what()); return false; } @@ -195,7 +195,7 @@ class DataSharingNotification catch (const std::exception& e) { logError(HISTORY_DATASHARING_LISTENER, "Failed to open segment " << segment_name_ - << ": " << e.what()); + << ": " << e.what()); return false; }