summaryrefslogtreecommitdiff
path: root/win/inspircd_namedpipe.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-20 10:27:46 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-20 10:27:46 +0000
commit7721a4de678967c527c4887e036f7a93722296ed (patch)
tree020780a638ea81113dd35efbfd3aed7080e3b581 /win/inspircd_namedpipe.cpp
parent1bdc61df779bbd74ca8641cde512dc0a1d8be4c0 (diff)
Checks to make sure that WMI initialises, if it doesnt we return -1 for CPU percentage
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10180 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'win/inspircd_namedpipe.cpp')
-rw-r--r--win/inspircd_namedpipe.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/win/inspircd_namedpipe.cpp b/win/inspircd_namedpipe.cpp
index f86af73e2..06649d103 100644
--- a/win/inspircd_namedpipe.cpp
+++ b/win/inspircd_namedpipe.cpp
@@ -8,7 +8,8 @@
IPCThread::IPCThread(InspIRCd* Instance) : Thread(), ServerInstance(Instance)
{
- initwmi();
+ if (!initwmi())
+ ServerInstance->Logs->Log("IPC", DEBUG, "Could not initialise WMI. CPU percantage reports will not be available.");
}
IPCThread::~IPCThread()
@@ -23,15 +24,15 @@ void IPCThread::Run()
while (GetExitFlag() == false)
{
Pipe = CreateNamedPipe (Pipename,
- PIPE_ACCESS_DUPLEX, // read/write access
- PIPE_TYPE_MESSAGE | // message type pipe
- PIPE_READMODE_MESSAGE | // message-read mode
- PIPE_WAIT, // blocking mode
- PIPE_UNLIMITED_INSTANCES, // max. instances
- MAXBUF, // output buffer size
- MAXBUF, // input buffer size
- 1000, // client time-out
- NULL); // no security attribute
+ PIPE_ACCESS_DUPLEX, // read/write access
+ PIPE_TYPE_MESSAGE | // message type pipe
+ PIPE_READMODE_MESSAGE | // message-read mode
+ PIPE_WAIT, // blocking mode
+ PIPE_UNLIMITED_INSTANCES, // max. instances
+ MAXBUF, // output buffer size
+ MAXBUF, // input buffer size
+ 1000, // client time-out
+ NULL); // no security attribute
if (Pipe == INVALID_HANDLE_VALUE)
{