[asterisk-commits] qwell: branch 1.4 r103503 - in /branches/1.4: contrib/scripts/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 12 16:22:56 CST 2008


Author: qwell
Date: Tue Feb 12 16:22:54 2008
New Revision: 103503

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103503
Log:
Remove condition that was impossible.

Modified:
    branches/1.4/contrib/scripts/safe_asterisk
    branches/1.4/main/asterisk.c

Modified: branches/1.4/contrib/scripts/safe_asterisk
URL: http://svn.digium.com/view/asterisk/branches/1.4/contrib/scripts/safe_asterisk?view=diff&rev=103503&r1=103502&r2=103503
==============================================================================
--- branches/1.4/contrib/scripts/safe_asterisk (original)
+++ branches/1.4/contrib/scripts/safe_asterisk Tue Feb 12 16:22:54 2008
@@ -149,18 +149,13 @@
 				mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
 			fi
 		else
-			if [ "${EXITSTATUS}" = "0" ]; then
-				echo "Asterisk ended normally.  Aborting."
-				exit 0
-			else
-				echo "Asterisk died with code $EXITSTATUS."
+			echo "Asterisk died with code $EXITSTATUS."
 
-				PID=`cat ${ASTPIDFILE}`
-				if [ -f /tmp/core.${PID} ]; then
-					mv /tmp/core.${PID} ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
-				elif [ -f /tmp/core ]; then
-					mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
-				fi
+			PID=`cat ${ASTPIDFILE}`
+			if [ -f /tmp/core.${PID} ]; then
+				mv /tmp/core.${PID} ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
+			elif [ -f /tmp/core ]; then
+				mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` &
 			fi
 		fi
 		echo "Automatically restarting Asterisk."

Modified: branches/1.4/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/asterisk.c?view=diff&rev=103503&r1=103502&r2=103503
==============================================================================
--- branches/1.4/main/asterisk.c (original)
+++ branches/1.4/main/asterisk.c Tue Feb 12 16:22:54 2008
@@ -1721,7 +1721,8 @@
 	struct pollfd fds[2];
 	int res;
 	int max;
-	char buf[512];
+#define EL_BUF_SIZE 512
+	char buf[EL_BUF_SIZE];
 
 	for (;;) {
 		max = 1;
@@ -1784,7 +1785,7 @@
 			if (!ast_opt_exec && !lastpos)
 				write(STDOUT_FILENO, "\r", 1);
 			write(STDOUT_FILENO, buf, res);
-			if ((buf[res-1] == '\n') || (buf[res-2] == '\n')) {
+			if ((res < EL_BUF_SIZE - 1) && ((buf[res-1] == '\n') || (buf[res-2] == '\n'))) {
 				*cp = CC_REFRESH;
 				return(1);
 			} else {




More information about the asterisk-commits mailing list