added HAVE_SYSINFO preprocessor directives for portability and general happiness

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Dwayne M. Hubbard
2007-04-11 20:59:08 +00:00
parent 97d93d091b
commit 6a5f3599bb
3 changed files with 23 additions and 1 deletions

View File

@@ -37,7 +37,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include <time.h>
#include <sys/time.h>
#include <limits.h>
#if HAVE_SYSINFO
#include <sys/sysinfo.h>
#endif
#include "asterisk/lock.h"
#include "asterisk/cli.h"
@@ -2453,8 +2455,10 @@ static int increase_call_count(const struct ast_channel *c)
{
int failed = 0;
double curloadavg;
#if HAVE_SYSINFO
long curfreemem;
struct sysinfo sys_info;
#endif
ast_mutex_lock(&maxcalllock);
if (option_maxcalls) {
@@ -2470,6 +2474,7 @@ static int increase_call_count(const struct ast_channel *c)
failed = -1;
}
}
#if HAVE_SYSINFO
if (option_minmemfree) {
if (!sysinfo(&sys_info)) {
/* make sure that the free system memory is above the configured low watermark
@@ -2482,6 +2487,7 @@ static int increase_call_count(const struct ast_channel *c)
}
}
}
#endif
if (!failed)
countcalls++;