Skip to content

Commit

Permalink
iox-#2150 Fix 'iox_open' for MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Jan 10, 2024
1 parent d5c65bb commit c469de5
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions iceoryx_platform/win/source/fnctl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,20 @@
//
// SPDX-License-Identifier: Apache-2.0

#include <io.h>

#include "iceoryx_platform/fcntl.hpp"
#include "iceoryx_platform/handle_translator.hpp"
#include "iceoryx_platform/win32_errorHandling.hpp"
#include "iceoryx_platform/windows.hpp"

#include <io.h>
#include <share.h>
#include <sys/stat.h>

int iox_open(const char* pathname, int flags, mode_t mode)
{
#if defined(__GNUC__) || defined(__GNUG__)
return open(pathname, flags, mode);
#elif defined(_MSC_VER)
int fd;
_sopen_s(&fd, pathname, flags, _SH_DENYNO, _S_IREAD | _S_IWRITE);
return fd;
#endif
}

int iox_ext_open(const char* pathname, int flags, mode_t mode)
Expand Down

0 comments on commit c469de5

Please sign in to comment.