[asterisk-commits] russell: branch 1.4 r43710 - in /branches/1.4: ./ main/asterisk.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Sep 26 13:56:43 MST 2006


Author: russell
Date: Tue Sep 26 15:56:42 2006
New Revision: 43710

URL: http://svn.digium.com/view/asterisk?rev=43710&view=rev
Log:
(This was actually BE-65)

Merged revisions 43708 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43708 | russell | 2006-09-26 16:49:21 -0400 (Tue, 26 Sep 2006) | 7 lines

Back in revision 4798, this message was changed from using ast_cli() to directly
calling write().  During this change, checking if this was a remote console was
removed.  This caused this message about using "exit" or "quit" to exit an
Asterisk console to come up in times where it did not make sense.  This change
restores the check to see if this is a remote console before printing the
message.  (fixes BE-4)

........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/main/asterisk.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: branches/1.4/main/asterisk.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/asterisk.c?rev=43710&r1=43709&r2=43710&view=diff
==============================================================================
--- branches/1.4/main/asterisk.c (original)
+++ branches/1.4/main/asterisk.c Tue Sep 26 15:56:42 2006
@@ -2816,19 +2816,17 @@
 					buf[strlen(buf)-1] = '\0';
 
 				consolehandler((char *)buf);
-			} else {
-				if (write(STDOUT_FILENO, "\nUse EXIT or QUIT to exit the asterisk console\n",
-					  strlen("\nUse EXIT or QUIT to exit the asterisk console\n")) < 0) {
-					/* Whoa, stdout disappeared from under us... Make /dev/null's */
-					int fd;
-					fd = open("/dev/null", O_RDWR);
-					if (fd > -1) {
-						dup2(fd, STDOUT_FILENO);
-						dup2(fd, STDIN_FILENO);
-					} else
-						ast_log(LOG_WARNING, "Failed to open /dev/null to recover from dead console. Bad things will happen!\n");
-					break;
-				}
+			} else if (ast_opt_remote && (write(STDOUT_FILENO, "\nUse EXIT or QUIT to exit the asterisk console\n",
+				   strlen("\nUse EXIT or QUIT to exit the asterisk console\n")) < 0)) {
+				/* Whoa, stdout disappeared from under us... Make /dev/null's */
+				int fd;
+				fd = open("/dev/null", O_RDWR);
+				if (fd > -1) {
+					dup2(fd, STDOUT_FILENO);
+					dup2(fd, STDIN_FILENO);
+				} else
+					ast_log(LOG_WARNING, "Failed to open /dev/null to recover from dead console. Bad things will happen!\n");
+				break;
 			}
 		}
 



More information about the asterisk-commits mailing list