[svn-commits] file: trunk r77876 - in /trunk/main: asterisk.c pbx.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Aug 1 14:12:37 CDT 2007


Author: file
Date: Wed Aug  1 14:12:36 2007
New Revision: 77876

URL: http://svn.digium.com/view/asterisk?view=rev&rev=77876
Log:
Solaris does not have a sysinfo like we know of on Linux.

Modified:
    trunk/main/asterisk.c
    trunk/main/pbx.c

Modified: trunk/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/main/asterisk.c?view=diff&rev=77876&r1=77875&r2=77876
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Wed Aug  1 14:12:36 2007
@@ -80,7 +80,7 @@
 #include <grp.h>
 #include <pwd.h>
 #include <sys/stat.h>
-#if defined(HAVE_SYSINFO)
+#if defined(HAVE_SYSINFO) && !defined(SOLARIS)
 #include <sys/sysinfo.h>
 #endif
 #ifdef linux
@@ -166,7 +166,7 @@
 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)
+#if defined(HAVE_SYSINFO) && !defined(SOLARIS)
 long option_minmemfree;				/*!< Minimum amount of free system memory - stop accepting calls if free memory falls below this watermark */
 #endif
 
@@ -360,7 +360,7 @@
 	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)
+#if defined(HAVE_SYSINFO) && !defined(SOLARIS)
 	ast_cli(fd, "  Min Free Memory:             %ld MB\n", option_minmemfree);
 #endif
 	if (ast_localtime(&ast_startuptime, &tm, NULL)) {
@@ -416,7 +416,7 @@
 	return 0;
 }
 
-#if defined(HAVE_SYSINFO)
+#if defined(HAVE_SYSINFO) && !defined(SOLARIS)
 static const char show_sysinfo_help[] =
 "Usage: core show sysinfo\n"
 "       List current system information.\n";
@@ -1647,7 +1647,7 @@
 	handle_show_threads, "Show running threads",
 	show_threads_help },
 
-#if defined(HAVE_SYSINFO)
+#if defined(HAVE_SYSINFO) && !defined(SOLARIS)
 	{ { "core", "show", "sysinfo", NULL },
 	handle_show_sysinfo, "Show System Information",
 	show_sysinfo_help },
@@ -2452,7 +2452,7 @@
 			}
 		} else if (!strcasecmp(v->name, "languageprefix")) {
 			ast_language_is_prefix = ast_true(v->value);
-#if defined(HAVE_SYSINFO)
+#if defined(HAVE_SYSINFO) && !defined(SOLARIS)
 		} 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 @@
 	/* Check for options */
 	while ((c = getopt(argc, argv, "mtThfFdvVqprRgciInx:U:G:C:L:M:e:")) != -1) {
 		switch (c) {
-#if defined(HAVE_SYSINFO)
+#if defined(HAVE_SYSINFO) && !defined(SOLARIS)
 		case 'e':
 			if ((sscanf(&optarg[1], "%ld", &option_minmemfree) != 1) || (option_minmemfree < 0)) {
 				option_minmemfree = 0;

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=77876&r1=77875&r2=77876
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Wed Aug  1 14:12:36 2007
@@ -37,7 +37,7 @@
 #include <time.h>
 #include <sys/time.h>
 #include <limits.h>
-#if defined(HAVE_SYSINFO)
+#if defined(HAVE_SYSINFO) && !defined(SOLARIS)
 #include <sys/sysinfo.h>
 #endif
 
@@ -2536,7 +2536,7 @@
 {
 	int failed = 0;
 	double curloadavg;
-#if defined(HAVE_SYSINFO)
+#if defined(HAVE_SYSINFO) && !defined(SOLARIS)
 	long curfreemem;
 	struct sysinfo sys_info;
 #endif
@@ -2555,7 +2555,7 @@
 			failed = -1;
 		}
 	}
-#if defined(HAVE_SYSINFO)
+#if defined(HAVE_SYSINFO) && !defined(SOLARIS)
 	if (option_minmemfree) {
 		if (!sysinfo(&sys_info)) {
 			/* make sure that the free system memory is above the configured low watermark




More information about the svn-commits mailing list