Skip to content

Commit

Permalink
iox-#1036 Fix FreeBSD unlink issue - missing /
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Eltzschig <me@elchris.org>
  • Loading branch information
elfenpiff committed Feb 7, 2022
1 parent eee632b commit 5f753e0
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions iceoryx_hoofs/source/posix_wrapper/named_pipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,13 @@ cxx::expected<bool, IpcChannelError> NamedPipe::isOutdated() noexcept

cxx::expected<bool, IpcChannelError> NamedPipe::unlinkIfExists(const IpcChannelName_t& name) noexcept
{
constexpr int ERROR_CODE = -1;
auto unlinkCall = posixCall(iox_shm_unlink)(convertName(NAMED_PIPE_PREFIX, name).c_str())
.failureReturnValue(ERROR_CODE)
.ignoreErrnos(ENOENT)
.evaluate();
if (!unlinkCall.has_error())
auto result = SharedMemory::unlinkIfExist(name);
if (result.has_error())
{
return cxx::success<bool>(unlinkCall->errnum != ENOENT);
return cxx::error<IpcChannelError>(IpcChannelError::INTERNAL_LOGIC_ERROR);
}

return cxx::error<IpcChannelError>(IpcChannelError::INTERNAL_LOGIC_ERROR);
return cxx::success<bool>(*result);
}

cxx::expected<IpcChannelError> NamedPipe::trySend(const std::string& message) const noexcept
Expand Down

0 comments on commit 5f753e0

Please sign in to comment.