[asterisk-commits] mmichelson: trunk r82283 - in /trunk/main: app.c asterisk.c pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 12 11:24:45 CDT 2007


Author: mmichelson
Date: Wed Sep 12 11:24:45 2007
New Revision: 82283

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82283
Log:
Fixes Solaris build warnings

(closes issue #10698, reported and patched by snuffy)


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

Modified: trunk/main/app.c
URL: http://svn.digium.com/view/asterisk/trunk/main/app.c?view=diff&rev=82283&r1=82282&r2=82283
==============================================================================
--- trunk/main/app.c (original)
+++ trunk/main/app.c Wed Sep 12 11:24:45 2007
@@ -39,6 +39,7 @@
 #include <sys/stat.h>
 #include <sys/file.h>
 #include <regex.h>
+#include <fcntl.h>
 
 #include "asterisk/channel.h"
 #include "asterisk/pbx.h"
@@ -1146,8 +1147,14 @@
 	pl->path = strdup(path);
 
 	time(&start);
-	while (((res = flock(pl->fd, LOCK_EX | LOCK_NB)) < 0) &&
-			(errno == EWOULDBLOCK) && (time(NULL) - start < 5))
+	while ((
+		#ifdef SOLARIS
+		(res = fcntl(pl->fd, F_SETLK, fcntl(pl->fd,F_GETFL)|O_NONBLOCK)) < 0) &&
+		#else
+		(res = flock(pl->fd, LOCK_EX | LOCK_NB)) < 0) &&
+		#endif
+			(errno == EWOULDBLOCK) && 
+			(time(NULL) - start < 5))
 		usleep(1000);
 	if (res) {
 		ast_log(LOG_WARNING, "Failed to lock path '%s': %s\n",

Modified: trunk/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/main/asterisk.c?view=diff&rev=82283&r1=82282&r2=82283
==============================================================================
--- trunk/main/asterisk.c (original)
+++ trunk/main/asterisk.c Wed Sep 12 11:24:45 2007
@@ -95,6 +95,7 @@
 #include <netdb.h>
 #if defined(SOLARIS)
 int daemon(int, int);  /* defined in libresolv of all places */
+#include <sys/loadavg.h>
 #endif
 #endif
 

Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=82283&r1=82282&r2=82283
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Wed Sep 12 11:24:45 2007
@@ -39,6 +39,9 @@
 #include <limits.h>
 #if defined(HAVE_SYSINFO)
 #include <sys/sysinfo.h>
+#endif
+#if defined(SOLARIS)
+#include <sys/loadavg.h>
 #endif
 
 #include "asterisk/lock.h"




More information about the asterisk-commits mailing list