[asterisk-commits] main/asterisk.c: Reverse #if statement in listener() to fix ... (asterisk[11])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 12 14:08:26 CST 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: main/asterisk.c: Reverse #if statement in listener() to fix code folding.
......................................................................


main/asterisk.c: Reverse #if statement in listener() to fix code folding.

listener() opens the same code block in two places (#if and #else).  This
confuses some folding editors causing it to think that an extra code block
was opened.  Folding in 'geany' causes all code after listener() to be
folded as if it were part of that procedure.

ASTERISK-24813 #close

Change-Id: I4b8c766e6c91e327dd445e8c18f8a6f268acd961
---
M main/asterisk.c
1 file changed, 3 insertions(+), 4 deletions(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/main/asterisk.c b/main/asterisk.c
index 7745d3f..16c0c34 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -1452,15 +1452,14 @@
 			if (errno != EINTR)
 				ast_log(LOG_WARNING, "Accept returned %d: %s\n", s, strerror(errno));
 		} else {
-#if !defined(SO_PASSCRED)
-			{
-#else
+#if defined(SO_PASSCRED)
 			int sckopt = 1;
 			/* turn on socket credentials passing. */
 			if (setsockopt(s, SOL_SOCKET, SO_PASSCRED, &sckopt, sizeof(sckopt)) < 0) {
 				ast_log(LOG_WARNING, "Unable to turn on socket credentials passing\n");
-			} else {
+			} else
 #endif
+			{
 				for (x = 0; x < AST_MAX_CONNECTS; x++) {
 					if (consoles[x].fd >= 0) {
 						continue;

-- 
To view, visit https://gerrit.asterisk.org/2244
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4b8c766e6c91e327dd445e8c18f8a6f268acd961
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-commits mailing list