Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iox #32 Mac OS fully supported #138

Merged
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d51ec38
iox-#32 fixing relocatable test and removing no longer needed ArgvIns…
elfenpiff Jun 4, 2020
8918ff5
Merge branch 'master' into iox-#32-unit-tests-for-mac
elfenpiff Jun 9, 2020
af08e4a
Merge branch 'iox-#132-fix-semaphore-timing-tests' into iox-#32-unit-…
elfenpiff Jun 9, 2020
265ce4f
iox-#132 fixing reimplement aligned_alloc for unit test
elfenpiff Jun 9, 2020
e6ef924
iox-#132 fixed aligned alloc in chunk mock -> again some reimplementa…
elfenpiff Jun 9, 2020
501c787
iox-#132 fixed infinite recursion in mac platform getgrouplist implem…
elfenpiff Jun 9, 2020
79f2f89
iox-#132 adjusting unix domain socket so that is compatible with the …
elfenpiff Jun 9, 2020
6d2f0c7
Merge branch 'master' of https://github.com/eclipse/iceoryx into iox-…
elfenpiff Jun 10, 2020
682d63f
iox-#32 fixing max message size for UnixDomainSockets on mac os and a…
elfenpiff Jun 10, 2020
576a31a
iox-#32 fixing timeout error in roudi when using unix domain sockets
elfenpiff Jun 10, 2020
746aadf
iox-#32 fixing bug in move ctor
elfenpiff Jun 10, 2020
942154e
iox-#32 added path prefix for sockets so that we have a central posit…
elfenpiff Jun 11, 2020
ff18f4d
iox-#32 adding global alias for communication type
elfenpiff Jun 11, 2020
6ae6be6
iox-#32 sendto behaves differently on mac os then on linux when sendi…
elfenpiff Jun 11, 2020
0eaa3fd
iox-#32 timedSend not supported in Mac OS, using send behavior instead
elfenpiff Jun 11, 2020
34dc8e4
iox-#32 sockets are stored in MQ_ROOT_PATH=/tmp/
elfenpiff Jun 11, 2020
1717a7b
iox-#32 named semaphore with empty name should never exist
elfenpiff Jun 11, 2020
b229366
iox-#32 fixed issue in semaphore behavior, named semaphores with empt…
elfenpiff Jun 11, 2020
afa1d0e
iox-#32 adjusting socket name length restrictions
elfenpiff Jun 11, 2020
844e59c
iox-#32 message queue race test is using sockets
elfenpiff Jun 11, 2020
1c1ab13
Merge branch 'master' of https://github.com/eclipse/iceoryx into iox-…
elfenpiff Jun 15, 2020
fc63788
iox-#32 mq startup races should not be possible when using sockets an…
elfenpiff Jun 15, 2020
5ee1425
iox-#32 adjusted resource release in unit tests with aligned memory
elfenpiff Jun 15, 2020
6df7b83
iox-#32 fixed CMqInterfaceStartupRace test
elfenpiff Jun 15, 2020
25bdb54
iox-#32 fixing startup race test
elfenpiff Jun 15, 2020
cc22098
iox-#32 fixing double export issue and adding introspection client to…
elfenpiff Jun 16, 2020
f60fae2
iox-#32 activating all tests for mac os
elfenpiff Jun 16, 2020
b24171a
iox-#32 added installation description for mac os
elfenpiff Jun 17, 2020
0764c78
iox-#32 removing unnecessary test
elfenpiff Jun 17, 2020
fadca40
iox-#32 removing warnings
elfenpiff Jun 17, 2020
72428da
iox-#32 creating timing test for failing mempool introspection test
elfenpiff Jun 17, 2020
0c58d9f
iox-#32 increased roudi environment waiting time, added vector compar…
elfenpiff Jun 17, 2020
6f14285
iox-#32 added default value for cells
elfenpiff Jun 17, 2020
9649130
iox-#32 ubuntu is trying to use the std::atomic copy ctor for default…
elfenpiff Jun 17, 2020
2276cc9
iox-#32 m_cells is always in an undefined state and has to be therefo…
elfenpiff Jun 17, 2020
d88bf96
iox-#32 run_all_tests.sh has parameters to disable all timing tests o…
elfenpiff Jun 18, 2020
848eafb
iox-#32 fixed review findings
elfenpiff Jun 18, 2020
cc766e5
iox-#32 added cyclone prerequisite for mac os
elfenpiff Jun 18, 2020
f3e33f9
iox-#32 further review findings
elfenpiff Jun 18, 2020
1d67c5a
iox-#32 the socket root path is added directly into UnixDomainSocket,…
elfenpiff Jun 18, 2020
046fdd4
iox-#32 removed deprecated MQ_ROOT_PATH
elfenpiff Jun 18, 2020
d7248de
iox-#32 fixing path prefix issue
elfenpiff Jun 18, 2020
80f1049
Merge branch 'master' of https://github.com/eclipse/iceoryx into iox-…
elfenpiff Jun 18, 2020
839d96e
iox-#32 fixed table misalignment
elfenpiff Jun 18, 2020
5b9ee70
iox-#32 implemented a platform independent C++11 alignedAlloc/aligned…
elfenpiff Jun 23, 2020
39ce8bc
iox-#32 added missing helplets.cpp
elfenpiff Jun 23, 2020
c63de96
iox-#32 fixed further review findings
elfenpiff Jun 24, 2020
a72b012
iox-#32 mepoo shared memory creation test is now a timing test. creat…
elfenpiff Jun 25, 2020
1dea2bc
iox-#32 fixed issue with negative Duration values when constructing f…
elfenpiff Jun 25, 2020
da6d31e
iox-#32 adjust CMakeLists.txt to be able to use cmake 3.5
elBoberido Feb 18, 2020
199aa63
iox-#32 cleanup build structure
elBoberido Feb 27, 2020
cb6c68e
iox-#32 fix cpptoml and googletest build on windows
elBoberido Feb 27, 2020
ceccf1f
iox-#32 added license header, adjusted paths in readme and added COLC…
elfenpiff Jun 25, 2020
16c040d
iox-#32 removing iceoryx prefix again ...
elfenpiff Jun 25, 2020
ce11042
iox-#32 disabled stress tests
elfenpiff Jun 25, 2020
0fc970a
iox-#32 merging with master and reverting PROJECT_PREFIX to not use i…
elfenpiff Jun 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,26 @@ namespace popo
class SenderPort;
class ReceiverPort;
} // namespace popo
namespace posix
{
class UnixDomainSocket;
class MessageQueue;
} // namespace posix

using SenderPortType = iox::popo::SenderPort;
using ReceiverPortType = iox::popo::ReceiverPort;

constexpr char MQ_ROUDI_NAME[] = "/roudi";
/// @brief The socket is created in the current path if no absolute path is given hence
/// we need an absolut path so that every application knows where our sockets can
/// be found.
#if defined(__APPLE__)
constexpr char MQ_ROOT_PATH[] = "/tmp";
elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
using CommunicationType = iox::posix::UnixDomainSocket;
elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
#else
constexpr char MQ_ROOT_PATH[] = "";
using CommunicationType = iox::posix::MessageQueue;
#endif

/// shared memmory segment for the iceoryx managment data
constexpr char SHM_NAME[] = "/iceoryx_mgmt";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "iceoryx_posh/iceoryx_posh_types.hpp"
#include "iceoryx_posh/internal/runtime/message_queue_message.hpp"
#include "iceoryx_utils/internal/posix_wrapper/message_queue.hpp"
#include "iceoryx_utils/internal/posix_wrapper/unix_domain_socket.hpp"
#include "iceoryx_utils/internal/units/duration.hpp"
#include "iceoryx_utils/platform/fcntl.hpp"
#include "iceoryx_utils/platform/mqueue.hpp"
Expand Down Expand Up @@ -227,7 +228,7 @@ class MqBase
long m_maxMessageSize{0};
long m_maxMessages{0};
iox::posix::IpcChannelSide m_channelSide{posix::IpcChannelSide::CLIENT};
iox::posix::MessageQueue m_mq;
CommunicationType m_mq;
};

/// @brief Class for handling a message queue via mq_open and mq_close.
Expand Down
12 changes: 8 additions & 4 deletions iceoryx_posh/source/runtime/message_queue_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,13 @@ bool MqBase::openMessageQueue(const posix::IpcChannelSide channelSide) noexcept
m_mq.destroy();

m_channelSide = channelSide;
posix::MessageQueue::create(
m_interfaceName, posix::IpcChannelMode::BLOCKING, m_channelSide, m_maxMessageSize, m_maxMessages)
CommunicationType::create(std::string(MQ_ROOT_PATH) + m_interfaceName,
elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
posix::IpcChannelMode::BLOCKING,
m_channelSide,
m_maxMessageSize,
m_maxMessages)
.on_success(
[this](cxx::expected<posix::MessageQueue, posix::IpcChannelError>& mq) { this->m_mq = std::move(*mq); });
[this](cxx::expected<CommunicationType, posix::IpcChannelError>& mq) { this->m_mq = std::move(*mq); });
elfenpiff marked this conversation as resolved.
Show resolved Hide resolved

return m_mq.isInitialized();
}
Expand All @@ -190,7 +193,7 @@ bool MqBase::hasClosableMessageQueue() const noexcept

void MqBase::cleanupOutdatedMessageQueue(const std::string& name) noexcept
{
if (posix::MessageQueue::unlinkIfExists(name).get_value_or(false))
if (posix::MessageQueue::unlinkIfExists(std::string(MQ_ROOT_PATH) + name).get_value_or(false))
{
LogWarn() << "MQ still there, doing an unlink of " << name;
}
Expand Down Expand Up @@ -238,6 +241,7 @@ MqRuntimeInterface::MqRuntimeInterface(const std::string& roudiName,

int64_t transmissionTimestamp{0};
auto regState = RegState::WAIT_FOR_ROUDI;
// regState = RegState::SEND_REGISTER_REQUEST;
elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
while (!timer.hasExpiredComparedToCreationTime() && regState != RegState::FINISHED)
{
if (!m_RoudiMqInterface.isInitialized() || !m_RoudiMqInterface.mqMapsToFile())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "iceoryx_posh/iceoryx_posh_types.hpp"
#include "test.hpp"

#include "iceoryx_posh/internal/runtime/message_queue_interface.hpp"
Expand All @@ -33,12 +34,14 @@ using iox::runtime::MqMessage;
using iox::runtime::MqMessageType;
using iox::runtime::MqRuntimeInterface;

using MQueue = iox::posix::MessageQueue;

constexpr char MqRouDiName[] = "/roudi";
constexpr char MqAppName[] = "/racer";

#if defined(__APPLE__)
constexpr char DeleteRouDiMessageQueue[] = "rm /tmp/roudi";
#else
constexpr char DeleteRouDiMessageQueue[] = "rm /dev/mqueue/roudi";
elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
#endif

constexpr char MqAppName[] = "/racer";

class StringToMessage : public MqBase
{
Expand All @@ -50,7 +53,7 @@ class CMqInterfaceStartupRace_test : public Test
{
public:
CMqInterfaceStartupRace_test()
: m_appQueue{MQueue::create()}
: m_appQueue{CommunicationType::create()}
{
}

Expand Down Expand Up @@ -93,7 +96,8 @@ class CMqInterfaceStartupRace_test : public Test

if (m_appQueue.has_error())
{
m_appQueue = MQueue::create(MqAppName, IpcChannelMode::BLOCKING, IpcChannelSide::CLIENT);
m_appQueue = CommunicationType::create(
std::string(MQ_ROOT_PATH) + MqAppName, IpcChannelMode::BLOCKING, IpcChannelSide::CLIENT);
}
ASSERT_THAT(m_appQueue.has_error(), false);

Expand All @@ -102,12 +106,13 @@ class CMqInterfaceStartupRace_test : public Test

/// @note smart_lock in combination with optional is currently not really usable
std::mutex m_roudiQueueMutex;
MQueue::result_t m_roudiQueue{
MQueue::create(MqRouDiName, IpcChannelMode::BLOCKING, IpcChannelSide::SERVER)};
CommunicationType::result_t m_roudiQueue{CommunicationType::create(
std::string(MQ_ROOT_PATH) + MQ_ROUDI_NAME, IpcChannelMode::BLOCKING, IpcChannelSide::SERVER)};
std::mutex m_appQueueMutex;
MQueue::result_t m_appQueue;
CommunicationType::result_t m_appQueue;
};

#if !defined(__APPLE__)
TEST_F(CMqInterfaceStartupRace_test, ObsoleteRouDiMq)
{
/// @note this test checks if the application handles the situation when the roudi mqueue was not properly cleaned
Expand All @@ -127,7 +132,8 @@ TEST_F(CMqInterfaceStartupRace_test, ObsoleteRouDiMq)

// simulate the restart of RouDi with the mqueue cleanup
system(DeleteRouDiMessageQueue);
auto m_roudiQueue2 = MQueue::create(MqRouDiName, IpcChannelMode::BLOCKING, IpcChannelSide::SERVER);
auto m_roudiQueue2 = CommunicationType::create(
std::string(MQ_ROOT_PATH) + MQ_ROUDI_NAME, IpcChannelMode::BLOCKING, IpcChannelSide::SERVER);

// check if the app retries to register at RouDi
request = m_roudiQueue2->timedReceive(15_s);
Expand All @@ -143,7 +149,7 @@ TEST_F(CMqInterfaceStartupRace_test, ObsoleteRouDiMq)
}
});

MqRuntimeInterface dut(MqRouDiName, MqAppName, 35_s);
MqRuntimeInterface dut(MQ_ROUDI_NAME, MqAppName, 35_s);

shutdown = true;
roudi.join();
Expand All @@ -169,7 +175,8 @@ TEST_F(CMqInterfaceStartupRace_test, ObsoleteRouDiMqWithFullMq)

// simulate the restart of RouDi with the mqueue cleanup
system(DeleteRouDiMessageQueue);
auto newRoudi = MQueue::create(MqRouDiName, IpcChannelMode::BLOCKING, IpcChannelSide::SERVER);
auto newRoudi = CommunicationType::create(
std::string(MQ_ROOT_PATH) + MQ_ROUDI_NAME, IpcChannelMode::BLOCKING, IpcChannelSide::SERVER);

// check if the app retries to register at RouDi
auto request = newRoudi->timedReceive(15_s);
Expand All @@ -192,11 +199,12 @@ TEST_F(CMqInterfaceStartupRace_test, ObsoleteRouDiMqWithFullMq)
}
});

MqRuntimeInterface dut(MqRouDiName, MqAppName, 35_s);
MqRuntimeInterface dut(MQ_ROUDI_NAME, MqAppName, 35_s);

shutdown = true;
roudi.join();
}
#endif

TEST_F(CMqInterfaceStartupRace_test, ObsoleteRegAck)
{
Expand Down Expand Up @@ -231,7 +239,7 @@ TEST_F(CMqInterfaceStartupRace_test, ObsoleteRegAck)
}
});

MqRuntimeInterface dut(MqRouDiName, MqAppName, 35_s);
MqRuntimeInterface dut(MQ_ROUDI_NAME, MqAppName, 35_s);

shutdown = true;
roudi.join();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.#include "test.hpp"

#if !defined(__APPLE__)

#include "iceoryx_posh/iceoryx_posh_config.hpp"
#include "iceoryx_posh/internal/roudi/memory/mempool_collection_memory_block.hpp"
#include "iceoryx_posh/mepoo/mepoo_config.hpp"
Expand Down Expand Up @@ -52,3 +54,5 @@ TEST(ShmCreatorDeathTest, AllocatingTooMuchMemoryLeadsToExitWithSIGBUS)
goodShmProvider.create();
}
} // namespace

#endif
14 changes: 12 additions & 2 deletions iceoryx_posh/test/mocks/chunk_mock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,18 @@ class ChunkMock
{
#if defined(QNX) || defined(QNX__) || defined(__QNX__)
m_rawMemory = static_cast<uint8_t*>(memalign(Alignment, Size));
m_unalignedMemory = m_rawMemory;
#elif defined(__APPLE__)
uint64_t memOffset = reinterpret_cast<uint64_t>(malloc(Size + Alignment));
m_unalignedMemory = reinterpret_cast<uint8_t*>(memOffset);
memOffset += memOffset % Alignment;
m_rawMemory = reinterpret_cast<uint8_t*>(memOffset);
#elif defined(_WIN32)
m_rawMemory = static_cast<uint8_t*>(_aligned_malloc(Alignment, Size));
m_unalignedMemory = m_rawMemory;
#else
m_rawMemory = static_cast<uint8_t*>(aligned_alloc(Alignment, Size));
m_unalignedMemory = m_rawMemory;
#endif
assert(m_rawMemory != nullptr && "Could not get aligned memory");

elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -50,9 +58,10 @@ class ChunkMock
{
m_chunkHeader->~ChunkHeader();
}
if (m_rawMemory != nullptr)
if (m_unalignedMemory != nullptr)
elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
{
free(m_rawMemory);
free(m_unalignedMemory);
m_unalignedMemory = nullptr;
m_rawMemory = nullptr;
}
}
Expand All @@ -78,6 +87,7 @@ class ChunkMock
uint8_t* m_rawMemory{nullptr};
iox::mepoo::ChunkHeader* m_chunkHeader = nullptr;
Topic* m_topic = nullptr;
void* m_unalignedMemory{nullptr};
};

#endif // IOX_POSH_MOCKS_CHUNK_MOCK_HPP
5 changes: 5 additions & 0 deletions iceoryx_posh/test/mocks/roudi_memory_provider_mock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class MemoryProviderTestImpl : public iox::roudi::MemoryProvider

#if defined(QNX) || defined(QNX__) || defined(__QNX__)
dummyMemory = static_cast<uint8_t*>(memalign(alignment, size));
#elif defined(__APPLE__)
uint64_t memOffset = reinterpret_cast<uint64_t>(malloc(size + alignment));
dummyMemory = reinterpret_cast<uint8_t*>(memOffset);
memOffset += memOffset % alignment;
elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
return iox::cxx::success<void*>(reinterpret_cast<void*>(memOffset));
#else
dummyMemory = static_cast<uint8_t*>(aligned_alloc(alignment, size));
#endif
elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
1 change: 0 additions & 1 deletion iceoryx_utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ add_library(iceoryx_utils
source/log/logstream.cpp
source/log/ac3log_shim/simplelogger.cpp
source/posix_wrapper/access_control.cpp
source/posix_wrapper/argv_inspection.cpp
source/posix_wrapper/mutex.cpp
source/posix_wrapper/semaphore.cpp
source/posix_wrapper/timer.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ArgvInspector

elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
private:
cxx::optional<std::string> m_cmdline;
};
} m
elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
} // namespace posix
} // namespace iox

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ enum class IpcChannelError : uint8_t
OUT_OF_MEMORY,
INVALID_FILE_DESCRIPTOR,
I_O_ERROR,
CONNECTION_RESET_BY_PEER,
UNDEFINED
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ namespace posix
class UnixDomainSocket : public DesignPattern::Creation<UnixDomainSocket, IpcChannelError>
{
public:
static constexpr size_t MAX_MESSAGE_SIZE = 4096u;
/// @brief Max message size is on linux = 4096 and on mac os = 2048. To have
/// the same behavior on every platform we use 2048.
static constexpr size_t MAX_MESSAGE_SIZE = 2048u;
static constexpr size_t SHORTEST_VALID_NAME = 2u;
static constexpr size_t LONGEST_VALID_NAME = 100u;
/// @brief The name has to contain the full path besides the name and has to
/// be therefore much longer then the message queue pendant.
static constexpr size_t LONGEST_VALID_NAME = 1024u;
static constexpr int32_t ERROR_CODE = -1;
static constexpr int32_t INVALID_FD = -1;

Expand Down Expand Up @@ -64,22 +68,22 @@ class UnixDomainSocket : public DesignPattern::Creation<UnixDomainSocket, IpcCha
/// @brief send a message using std::string.
/// @param msg to send
/// @return IpcChannelError if error occured
cxx::expected<IpcChannelError> send(const std::string& msg) noexcept;
cxx::expected<IpcChannelError> send(const std::string& msg) const noexcept;

/// @brief try to send a message for a given timeout duration using std::string
/// @param msg to send
/// @param timout for the send operation
/// @return IpcChannelError if error occured
cxx::expected<IpcChannelError> timedSend(const std::string& msg, const units::Duration& timeout) noexcept;
cxx::expected<IpcChannelError> timedSend(const std::string& msg, const units::Duration& timeout) const noexcept;

/// @brief receive message using std::string.
/// @return received message. In case of an error, IpcChannelError is returned and msg is empty.
cxx::expected<std::string, IpcChannelError> receive() noexcept;
cxx::expected<std::string, IpcChannelError> receive() const noexcept;

/// @brief try to receive message for a given timeout duration using std::string.
/// @param timout for the receive operation
/// @return received message. In case of an error, IpcChannelError is returned and msg is empty.
cxx::expected<std::string, IpcChannelError> timedReceive(const units::Duration& timeout) noexcept;
cxx::expected<std::string, IpcChannelError> timedReceive(const units::Duration& timeout) const noexcept;

/// @brief checks whether the unix domain socket is outdated
/// @return true if the unix domain socket is outdated, false otherwise, IpcChannelError if error occured
Expand All @@ -105,7 +109,9 @@ class UnixDomainSocket : public DesignPattern::Creation<UnixDomainSocket, IpcCha

/// @brief create an IpcChannelError from the provides error code
/// @return IpcChannelError if error occured
cxx::error<IpcChannelError> createErrorFromErrnum(const int32_t errnum) noexcept;
cxx::error<IpcChannelError> createErrorFromErrnum(const int32_t errnum) const noexcept;

static bool isNameValid(const std::string& name) noexcept;

private:
std::string m_name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// with the correct argument types and just forward all arguments
inline int getgrouplist(const char* user, gid_t group, gid_t* groups, int* ngroups)
{
return getgrouplist(user, group, groups, ngroups);
return getgrouplist(user, static_cast<int>(group), reinterpret_cast<int*>(groups), ngroups);
}

#endif // IOX_UTILS_MAC_PLATFORM_GRP_HPP
5 changes: 5 additions & 0 deletions iceoryx_utils/platform/mac/source/semaphore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ int iox_sem_unlink(const char* name)

iox_sem_t* iox_sem_open_impl(const char* name, int oflag, ...)
{
if (strlen(name) == 0)
elfenpiff marked this conversation as resolved.
Show resolved Hide resolved
{
return reinterpret_cast<iox_sem_t*>(SEM_FAILED);
}

iox_sem_t* sem = new iox_sem_t;

if (oflag & (O_CREAT | O_EXCL))
Expand Down
Loading