diff --git a/configure b/configure index c6eba581f236c9f9a0fcd7b933c4353ed3260b85..d5b42345377b5d7ac86224da441c8e5e93488f74 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 77866 . +# From configure.ac Revision: 77875 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # @@ -16120,7 +16120,7 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -struct sysinfo sys_info; +struct sysinfo sys_info; int uptime = sys_info.uptime ; return 0; } diff --git a/configure.ac b/configure.ac index c32eb54a2a117052b300b3f31637c19ed5f498c2..cb6bc26b6235e2cd4323447bc7bb2d7640f6d7ec 100644 --- a/configure.ac +++ b/configure.ac @@ -382,7 +382,7 @@ AC_SUBST(AST_DECLARATION_AFTER_STATEMENT) AC_MSG_CHECKING(for sysinfo) AC_LINK_IFELSE( AC_LANG_PROGRAM([#include <sys/sysinfo.h>], - [struct sysinfo sys_info;]), + [struct sysinfo sys_info; int uptime = sys_info.uptime]), AC_MSG_RESULT(yes) AC_DEFINE([HAVE_SYSINFO], 1, [Define to 1 if your system has sysinfo support]), AC_MSG_RESULT(no) diff --git a/main/asterisk.c b/main/asterisk.c index 0dfe19835eec729f8df4dc51e0a9cd9dc9a8ac7a..118dd2982d100024e1a8c97d6891704934b4e2e1 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -80,7 +80,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <grp.h> #include <pwd.h> #include <sys/stat.h> -#if defined(HAVE_SYSINFO) && !defined(SOLARIS) +#if defined(HAVE_SYSINFO) #include <sys/sysinfo.h> #endif #ifdef linux @@ -166,7 +166,7 @@ int option_debug; /*!< Debug level */ double option_maxload; /*!< Max load avg on system */ int option_maxcalls; /*!< Max number of active calls */ int option_maxfiles; /*!< Max number of open file handles (files, sockets) */ -#if defined(HAVE_SYSINFO) && !defined(SOLARIS) +#if defined(HAVE_SYSINFO) long option_minmemfree; /*!< Minimum amount of free system memory - stop accepting calls if free memory falls below this watermark */ #endif @@ -360,7 +360,7 @@ static int handle_show_settings(int fd, int argc, char *argv[]) ast_cli(fd, " Verbosity: %d\n", option_verbose); ast_cli(fd, " Debug level: %d\n", option_debug); ast_cli(fd, " Max load avg: %lf\n", option_maxload); -#if defined(HAVE_SYSINFO) && !defined(SOLARIS) +#if defined(HAVE_SYSINFO) ast_cli(fd, " Min Free Memory: %ld MB\n", option_minmemfree); #endif if (ast_localtime(&ast_startuptime, &tm, NULL)) { @@ -416,7 +416,7 @@ static int handle_show_threads(int fd, int argc, char *argv[]) return 0; } -#if defined(HAVE_SYSINFO) && !defined(SOLARIS) +#if defined(HAVE_SYSINFO) static const char show_sysinfo_help[] = "Usage: core show sysinfo\n" " List current system information.\n"; @@ -1647,7 +1647,7 @@ static struct ast_cli_entry cli_asterisk[] = { handle_show_threads, "Show running threads", show_threads_help }, -#if defined(HAVE_SYSINFO) && !defined(SOLARIS) +#if defined(HAVE_SYSINFO) { { "core", "show", "sysinfo", NULL }, handle_show_sysinfo, "Show System Information", show_sysinfo_help }, @@ -2452,7 +2452,7 @@ static void ast_readconfig(void) } } else if (!strcasecmp(v->name, "languageprefix")) { ast_language_is_prefix = ast_true(v->value); -#if defined(HAVE_SYSINFO) && !defined(SOLARIS) +#if defined(HAVE_SYSINFO) } else if (!strcasecmp(v->name, "minmemfree")) { /* specify the minimum amount of free memory to retain. Asterisk should stop accepting new calls * if the amount of free memory falls below this watermark */ @@ -2533,7 +2533,7 @@ int main(int argc, char *argv[]) /* Check for options */ while ((c = getopt(argc, argv, "mtThfFdvVqprRgciInx:U:G:C:L:M:e:")) != -1) { switch (c) { -#if defined(HAVE_SYSINFO) && !defined(SOLARIS) +#if defined(HAVE_SYSINFO) case 'e': if ((sscanf(&optarg[1], "%ld", &option_minmemfree) != 1) || (option_minmemfree < 0)) { option_minmemfree = 0; diff --git a/main/pbx.c b/main/pbx.c index b2e6c704815bb522df3715dfa43412a4461f560a..419523db9fe6eaec9c6cbcba40ddc6d37695afa5 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -37,7 +37,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include <time.h> #include <sys/time.h> #include <limits.h> -#if defined(HAVE_SYSINFO) && !defined(SOLARIS) +#if defined(HAVE_SYSINFO) #include <sys/sysinfo.h> #endif @@ -2536,7 +2536,7 @@ static int increase_call_count(const struct ast_channel *c) { int failed = 0; double curloadavg; -#if defined(HAVE_SYSINFO) && !defined(SOLARIS) +#if defined(HAVE_SYSINFO) long curfreemem; struct sysinfo sys_info; #endif @@ -2555,7 +2555,7 @@ static int increase_call_count(const struct ast_channel *c) failed = -1; } } -#if defined(HAVE_SYSINFO) && !defined(SOLARIS) +#if defined(HAVE_SYSINFO) if (option_minmemfree) { if (!sysinfo(&sys_info)) { /* make sure that the free system memory is above the configured low watermark