mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 20:08:17 +00:00
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:
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user