diff options
| author | Nay <dnpd.dd@gmail.com> | 2013-07-29 14:24:33 +0100 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2013-07-29 14:24:53 +0100 |
| commit | 1bb3c4a2b4e3e974f09c0df478245f8daa3a677c (patch) | |
| tree | c4031c9b953ea759e6eb650b3596f34d7ae6808d /src/server/worldserver | |
| parent | 3b78023100109db9e70615162de114e606f1a2ce (diff) | |
Misc: Fix warnings and build
Closes #10396
Diffstat (limited to 'src/server/worldserver')
| -rw-r--r-- | src/server/worldserver/Master.cpp | 10 | ||||
| -rw-r--r-- | src/server/worldserver/RemoteAccess/RARunnable.cpp | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index 88a69cf2eb2..6fd57179140 100644 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -50,6 +50,12 @@ extern int m_ServiceStatus; #endif +#ifdef __linux__ +#include <sched.h> +#include <sys/resource.h> +#define PROCESS_HIGH_PRIORITY -15 // [-20, 19], default is 0 +#endif + /// Handle worldservers's termination signals class WorldServerSignalHandler : public Trinity::SignalHandler { @@ -231,7 +237,7 @@ int Master::Run() if (affinity & (1 << i)) CPU_SET(i, &mask); - if (int err = sched_setaffinity(0, sizeof(mask), &mask)) + if (sched_setaffinity(0, sizeof(mask), &mask)) TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Can't set used processors (hex): %x, error: %s", affinity, strerror(errno)); else { @@ -243,7 +249,7 @@ int Master::Run() if (highPriority) { - if (int err = setpriority(PRIO_PROCESS, 0, PROCESS_HIGH_PRIORITY)) + if (setpriority(PRIO_PROCESS, 0, PROCESS_HIGH_PRIORITY)) TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Can't set worldserver process priority class, error: %s", strerror(errno)); else TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "worldserver process priority class set to %i", getpriority(PRIO_PROCESS, 0)); diff --git a/src/server/worldserver/RemoteAccess/RARunnable.cpp b/src/server/worldserver/RemoteAccess/RARunnable.cpp index c381c65e9e2..1493df7aa2f 100644 --- a/src/server/worldserver/RemoteAccess/RARunnable.cpp +++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp @@ -75,7 +75,8 @@ void RARunnable::run() while (!World::IsStopped()) { - if (m_Reactor->run_reactor_event_loop(ACE_Time_Value(0, 100000)) == -1) + ACE_Time_Value interval(0, 100000); + if (m_Reactor->run_reactor_event_loop(interval) == -1) break; } |
