diff options
author | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-03 10:42:08 +0000 |
---|---|---|
committer | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-06-03 10:42:08 +0000 |
commit | 461839e0f9902888873b88d52183482262da63f7 (patch) | |
tree | 319b906c8beceaabd5591ee05abee39e987b5e79 | |
parent | afc03e1287aa042bc73b237665237e5e172e7c33 (diff) |
Probably fix 2nd compile issue on RH7 and add some checks which *should* ensure none of this can break anything else
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7223 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/cmd_stats.cpp | 6 | ||||
-rw-r--r-- | src/inspircd.cpp | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/cmd_stats.cpp b/src/cmd_stats.cpp index 9a0dc5ef7..037ffe304 100644 --- a/src/cmd_stats.cpp +++ b/src/cmd_stats.cpp @@ -15,6 +15,12 @@ #include "configreader.h" #ifndef WIN32 #include <sys/resource.h> + +/* This is just to be completely certain that the change which fixed getrusage on RH7 doesn't break anything else -- Om */ +#ifndef RUSAGE_SELF +#define RUSAGE_SELF 0 +#endif + #endif #include "users.h" #include "modules.h" diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 1761d47fa..bcfc92c48 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -15,8 +15,16 @@ #include "configreader.h" #include <signal.h> #ifndef WIN32 + #include <dirent.h> #include <unistd.h> +#include <sys/resource.h> + +/* This is just to be completely certain that the change which fixed getrusage on RH7 doesn't break anything else -- Om */ +#ifndef RUSAGE_SELF +#define RUSAGE_SELF 0 +#endif + #endif #include <exception> #include <fstream> @@ -978,7 +986,8 @@ void InspIRCd::DoOneIteration(bool process_module_sockets) Timers->TickMissedTimers(TIME); } #ifndef WIN32 - if (!getrusage(0, &ru)) + /* Same change as in cmd_stats.cpp, use RUSAGE_SELF rather than '0' -- Om */ + if (!getrusage(RUSAGE_SELF, &ru)) { gettimeofday(&this->stats->LastSampled, NULL); this->stats->LastCPU = ru.ru_utime; |