Skip to content

Commit

Permalink
Using correct FD for socket and not including headears on non-unix fu…
Browse files Browse the repository at this point in the history
…nctions.
  • Loading branch information
TheMutta committed Jun 12, 2024
1 parent 283bbdc commit 5562d45
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pc/protocols/local_memshd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

#include "local_memshd.h"
#include "../PlatformDeviceFd.h"

#define MVLOG_UNIT_NAME local_memshd
#include "XLinkLog.h"

#if defined(__unix__)
#include <cstddef>
#include <cstring>
#include <fcntl.h>
Expand All @@ -14,11 +19,6 @@
#include <unistd.h>
#include <errno.h>

#define MVLOG_UNIT_NAME local_memshd
#include "XLinkLog.h"

#if defined(__unix__)

int shdmem_initialize() {
printf("Shared mem initialize function called\n");
return 0;
Expand Down Expand Up @@ -84,7 +84,7 @@ int shdmemPlatformServer(const char *devPathRead, const char *devPathWrite, void

// Store the socket and create a "unique" key instead
// (as file descriptors are reused and can cause a clash with lookups between scheduler and link)
*fd = createPlatformDeviceFdKey((void*) (uintptr_t) socketFd);
*fd = createPlatformDeviceFdKey((void*) (uintptr_t) clientFd);

return 0;

Expand Down

0 comments on commit 5562d45

Please sign in to comment.