1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-27 21:01:50 +03:00

Remove windows ifdefs

This commit is contained in:
Leonid Fedorov
2023-03-02 15:59:42 +00:00
parent 123c345b40
commit 56f2346083
328 changed files with 9 additions and 19602 deletions

View File

@ -27,10 +27,6 @@
#include <fcntl.h>
#include <cstdio>
#include <ctime>
#ifdef _MSC_VER
#include <io.h>
#include <psapi.h>
#endif
#include "messagequeue.h"
#include "bytestream.h"
@ -65,10 +61,6 @@ SlaveComm::SlaveComm(string hostname, SlaveDBRMNode* s)
: slave(s)
, currentSaveFile(NULL)
, journalh(NULL)
#ifdef _MSC_VER
, fPids(0)
, fMaxPids(64)
#endif
{
config::Config* config = config::Config::makeConfig();
string tmp;
@ -172,10 +164,6 @@ SlaveComm::SlaveComm(string hostname, SlaveDBRMNode* s)
SlaveComm::SlaveComm()
: currentSaveFile(NULL)
, journalh(NULL)
#ifdef _MSC_VER
, fPids(0)
, fMaxPids(64)
#endif
{
config::Config* config = config::Config::makeConfig();
@ -1972,9 +1960,7 @@ void SlaveComm::do_confirm()
tmp = savefile + (saveFileToggle ? 'A' : 'B');
slave->saveState(tmp);
#ifndef _MSC_VER
tmp += '\n';
#endif
int err = 0;
// MCOL-1558. Make the _current file relative to DBRMRoot.
@ -2024,7 +2010,6 @@ void SlaveComm::do_flushInodeCache()
return;
}
#ifdef __linux__
#ifdef USE_VERY_COMPLEX_DROP_CACHES
double elapsedTime = 0.0;
char msgChString[100];
@ -2083,7 +2068,6 @@ void SlaveComm::do_flushInodeCache()
}
}
#endif
#endif
reply << (uint8_t)ERR_OK;
@ -2144,11 +2128,6 @@ int SlaveComm::replayJournal(string prefix)
fName = prefix.substr(0, prefix.length() - 1) + "_journal";
}
#ifdef _MSC_VER
else if (tmp == "a" || tmp == "b")
fName = prefix.substr(0, prefix.length() - 1) + "_journal";
#endif
else
{
fName = prefix + "_journal";
@ -2267,7 +2246,6 @@ void SlaveComm::do_ownerCheck(ByteStream& msg)
}
// FIXME: needs to be refactored along with SessionManagerServer::lookupProcessStatus()
#if defined(__linux__)
bool SlaveComm::processExists(const uint32_t pid, const string& pname)
{
string stat;
@ -2300,68 +2278,6 @@ bool SlaveComm::processExists(const uint32_t pid, const string& pname)
return true;
}
#elif defined(_MSC_VER)
// FIXME
bool SlaveComm::processExists(const uint32_t pid, const string& pname)
{
boost::mutex::scoped_lock lk(fPidMemLock);
if (!fPids)
fPids = (DWORD*)malloc(fMaxPids * sizeof(DWORD));
DWORD needed = 0;
if (EnumProcesses(fPids, fMaxPids * sizeof(DWORD), &needed) == 0)
return false;
while (needed == fMaxPids * sizeof(DWORD))
{
fMaxPids *= 2;
fPids = (DWORD*)realloc(fPids, fMaxPids * sizeof(DWORD));
if (EnumProcesses(fPids, fMaxPids * sizeof(DWORD), &needed) == 0)
return false;
}
DWORD numPids = needed / sizeof(DWORD);
for (DWORD i = 0; i < numPids; i++)
{
if (fPids[i] == pid)
{
TCHAR szProcessName[MAX_PATH] = TEXT("<unknown>");
// Get a handle to the process.
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, fPids[i]);
// Get the process name.
if (hProcess != NULL)
{
HMODULE hMod;
DWORD cbNeeded;
if (EnumProcessModules(hProcess, &hMod, sizeof(hMod), &cbNeeded))
GetModuleBaseName(hProcess, hMod, szProcessName, sizeof(szProcessName) / sizeof(TCHAR));
CloseHandle(hProcess);
if (pname == szProcessName)
return true;
}
}
}
return false;
}
#elif defined(__FreeBSD__)
// FIXME
bool SlaveComm::processExists(const uint32_t pid, const string& pname)
{
return false;
}
#else
#error Need to port processExists()
#endif
void SlaveComm::do_dmlLockLBIDRanges(ByteStream& msg)
{