From a37812945e9701cc311ff451e1f312c39255adc2 Mon Sep 17 00:00:00 2001 From: Sergey Yakubov <sergey.yakubov@desy.de> Date: Thu, 7 Nov 2019 11:16:31 +0100 Subject: [PATCH] fix windows --- common/cpp/src/system_io/system_io.h | 4 ++-- common/cpp/src/system_io/system_io_windows.cpp | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/common/cpp/src/system_io/system_io.h b/common/cpp/src/system_io/system_io.h index 0c8813a2f..b3a1b1bd4 100644 --- a/common/cpp/src/system_io/system_io.h +++ b/common/cpp/src/system_io/system_io.h @@ -70,6 +70,8 @@ class SystemIO final : public IO { Error* err) const; void GetSubDirectoriesRecursively(const std::string& path, SubDirList* subdirs, Error* err) const; Error CreateDirectoryWithParents(const std::string& root_path, const std::string& path) const; + uint8_t* AllocateArray(uint64_t fsize, Error* err) const; + #if defined(__linux__) || defined (__APPLE__) // used to for epoll - assumed single epoll instance per class instance const int kMaxEpollEvents = 10; @@ -78,8 +80,6 @@ class SystemIO final : public IO { Error CreateEpoolIfNeeded(SocketDescriptor master_socket) const; Error ProcessNewConnection(SocketDescriptor master_socket, std::vector<std::string>* new_connections, ListSocketDescriptors* sockets_to_listen) const; - uint8_t* AllocateArray(uint64_t fsize, Error* err) const; - #endif public: ~SystemIO(); diff --git a/common/cpp/src/system_io/system_io_windows.cpp b/common/cpp/src/system_io/system_io_windows.cpp index 5c059643d..88e89827e 100644 --- a/common/cpp/src/system_io/system_io_windows.cpp +++ b/common/cpp/src/system_io/system_io_windows.cpp @@ -8,8 +8,6 @@ #include <fcntl.h> #include <iostream> #include <direct.h> -#include <mswsock.h> - using std::string; using std::vector; @@ -385,7 +383,7 @@ Error SystemIO::SendFile(SocketDescriptor socket_fd, const std::string& fname, s return GetLastError(); } - if (!TransmitFile(socket_fd, hFile, 0, 0, NULL, NULL, TF_USE_DEFAULT_WORKER)) { + if (!TransmitFile(socket_fd, hFile, 0, 0, NULL, NULL, 0)) { _close(hFile); return GetLastError(); } -- GitLab