aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-26 21:01:02 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-26 21:01:02 +0000
commit7e434158dcc83cde06e597cb2d96f8836bbb302d (patch)
treed331d75742d7af5d88070177c6bfa28866c88afc /main/asterisk.c
parent3ec950000aada4a6308417b58d1d52286dcef0e0 (diff)
Merged revisions 43710 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r43710 | russell | 2006-09-26 16:56:42 -0400 (Tue, 26 Sep 2006) | 17 lines (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) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@43715 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 011626d3a..2ece4c7d8 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -2753,19 +2753,17 @@ int main(int argc, char *argv[])
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;
}
}