]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
main/asterisk.c: Reverse #if statement in listener() to fix code folding. 43/2243/1
authorCorey Farrell <git@cfware.com>
Sat, 21 Feb 2015 02:51:35 +0000 (02:51 +0000)
committerCorey Farrell <git@cfware.com>
Fri, 12 Feb 2016 14:34:27 +0000 (09:34 -0500)
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

main/asterisk.c

index d99aaed189741a8416691b59d4d8a1f8076b35a7..0cecc51f7627b12bc0059490cc3d95b026c2edd7 100644 (file)
@@ -1608,15 +1608,14 @@ static void *listener(void *unused)
                        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;