[svn-commits] tzafrir: trunk r225803 - /trunk/channels/chan_dahdi.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Oct 26 06:34:10 CDT 2009


Author: tzafrir
Date: Mon Oct 26 06:34:06 2009
New Revision: 225803

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=225803
Log:
Re-arange code a bit to build in dev-mode without ss7

No change of functionality here. Just localized a variable and indented
code into blocks.

Modified:
    trunk/channels/chan_dahdi.c

Modified: trunk/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=225803&r1=225802&r2=225803
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Mon Oct 26 06:34:06 2009
@@ -4085,7 +4085,6 @@
 
 static void dahdi_enable_ec(struct dahdi_pvt *p)
 {
-	int x;
 	int res;
 	if (!p)
 		return;
@@ -4112,10 +4111,15 @@
 			/* Fall through */
 #ifdef HAVE_SS7
 		case SIG_SS7:
-			x = 1;
-			res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_AUDIOMODE, &x);
-			if (res)
-				ast_log(LOG_WARNING, "Unable to enable audio mode on channel %d (%s)\n", p->channel, strerror(errno));
+			{
+				int x = 1;
+				res = ioctl(p->subs[SUB_REAL].dfd, 
+						DAHDI_AUDIOMODE, &x);
+				if (res)
+					ast_log(LOG_WARNING, 
+							"Unable to enable audio mode on channel %d (%s)\n",
+							p->channel, strerror(errno));
+			}
 #endif
 			break;
 		default:
@@ -4361,7 +4365,7 @@
 
 static inline int dahdi_confmute(struct dahdi_pvt *p, int muted)
 {
-	int x, y, res;
+	int x, res;
 
 	x = muted;
 	switch (p->sig) {
@@ -4375,10 +4379,13 @@
 		/* Fall through */
 #ifdef HAVE_SS7
 	case SIG_SS7:
-		y = 1;
-		res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_AUDIOMODE, &y);
-		if (res)
-			ast_log(LOG_WARNING, "Unable to set audio mode on %d: %s\n", p->channel, strerror(errno));
+		{
+			int y = 1;
+			res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_AUDIOMODE, &y);
+			if (res)
+				ast_log(LOG_WARNING, "Unable to set audio mode on %d: %s\n", 
+						p->channel, strerror(errno));
+		}
 #endif
 		break;
 	default:




More information about the svn-commits mailing list