[asterisk-commits] rmudgett: branch 10 r350076 - in /branches/10: ./ main/asterisk.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Jan 9 11:04:25 CST 2012
Author: rmudgett
Date: Mon Jan 9 11:04:21 2012
New Revision: 350076
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=350076
Log:
Make Asterisk -x command line parameter imply -r parameter presence.
The Asterisk -x command line parameter is documented inconsistently.
* Made the -x documentation and behavior consistent.
* Since this is also a new year, updated the copyright notices while here.
(closes issue ASTERISK-19094)
Reported by: Eugene
Patches:
issueA19094_correct_asterisk_option_x.patch (license #5674) patch uploaded by Walter Doekes (modified)
Tested by: Eugene
........
Merged revisions 350075 from http://svn.asterisk.org/svn/asterisk/branches/1.8
Modified:
branches/10/ (props changed)
branches/10/main/asterisk.c
Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: branches/10/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/asterisk.c?view=diff&rev=350076&r1=350075&r2=350076
==============================================================================
--- branches/10/main/asterisk.c (original)
+++ branches/10/main/asterisk.c Mon Jan 9 11:04:21 2012
@@ -1,7 +1,7 @@
/*
* Asterisk -- An open source telephony toolkit.
*
- * Copyright (C) 1999 - 2010, Digium, Inc.
+ * Copyright (C) 1999 - 2012, Digium, Inc.
*
* Mark Spencer <markster at digium.com>
*
@@ -39,7 +39,7 @@
*
* \section copyright Copyright and Author
*
- * Copyright (C) 1999 - 2009, Digium, Inc.
+ * Copyright (C) 1999 - 2012, Digium, Inc.
* Asterisk is a <a href="http://www.digium.com/en/company/view-policy.php?id=Trademark-Policy">registered trademark</a>
* of <a href="http://www.digium.com">Digium, Inc</a>.
*
@@ -159,7 +159,7 @@
/*! \brief Welcome message when starting a CLI interface */
#define WELCOME_MESSAGE \
- ast_verbose("Asterisk %s, Copyright (C) 1999 - 2011 Digium, Inc. and others.\n" \
+ ast_verbose("Asterisk %s, Copyright (C) 1999 - 2012 Digium, Inc. and others.\n" \
"Created by Mark Spencer <markster at digium.com>\n" \
"Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.\n" \
"This is free software, with components licensed under the GNU General Public\n" \
@@ -986,7 +986,6 @@
/*! \brief NULL handler so we can collect the child exit status */
static void _null_sig_handler(int sig)
{
-
}
static struct sigaction null_sig_handler = {
@@ -1111,7 +1110,8 @@
/*!
* \brief mute or unmute a console from logging
*/
-void ast_console_toggle_mute(int fd, int silent) {
+void ast_console_toggle_mute(int fd, int silent)
+{
int x;
for (x = 0;x < AST_MAX_CONNECTS; x++) {
if (fd == consoles[x].fd) {
@@ -2835,8 +2835,9 @@
return 0;
}
-static int show_cli_help(void) {
- printf("Asterisk %s, Copyright (C) 1999 - 2010, Digium, Inc. and others.\n", ast_get_version());
+static int show_cli_help(void)
+{
+ printf("Asterisk %s, Copyright (C) 1999 - 2012, Digium, Inc. and others.\n", ast_get_version());
printf("Usage: asterisk [OPTIONS]\n");
printf("Valid Options:\n");
printf(" -V Display version number and exit\n");
@@ -2867,7 +2868,7 @@
printf(" -T Display the time in [Mmm dd hh:mm:ss] format for each line\n");
printf(" of output to the CLI\n");
printf(" -v Increase verbosity (multiple v's = more verbose)\n");
- printf(" -x <cmd> Execute command <cmd> (only valid with -r)\n");
+ printf(" -x <cmd> Execute command <cmd> (implies -r)\n");
printf(" -X Execute includes by default (allows #exec in asterisk.conf)\n");
printf(" -W Adjust terminal colors to compensate for a light background\n");
printf("\n");
@@ -3152,7 +3153,14 @@
stat(canary_filename, &canary_stat);
now = ast_tvnow();
if (now.tv_sec > canary_stat.st_mtime + 60) {
- ast_log(LOG_WARNING, "The canary is no more. He has ceased to be! He's expired and gone to meet his maker! He's a stiff! Bereft of life, he rests in peace. His metabolic processes are now history! He's off the twig! He's kicked the bucket. He's shuffled off his mortal coil, run down the curtain, and joined the bleeding choir invisible!! THIS is an EX-CANARY. (Reducing priority)\n");
+ ast_log(LOG_WARNING,
+ "The canary is no more. He has ceased to be! "
+ "He's expired and gone to meet his maker! "
+ "He's a stiff! Bereft of life, he rests in peace. "
+ "His metabolic processes are now history! He's off the twig! "
+ "He's kicked the bucket. He's shuffled off his mortal coil, "
+ "run down the curtain, and joined the bleeding choir invisible!! "
+ "THIS is an EX-CANARY. (Reducing priority)\n");
ast_set_priority(0);
pthread_exit(NULL);
}
@@ -3364,6 +3372,9 @@
ast_clear_flag(&ast_options, AST_OPT_FLAG_FORCE_BLACK_BACKGROUND);
break;
case 'x':
+ /* -r is implied by -x so set the flags -r sets as well. */
+ ast_set_flag(&ast_options, AST_OPT_FLAG_NO_FORK | AST_OPT_FLAG_REMOTE);
+
ast_set_flag(&ast_options, AST_OPT_FLAG_EXEC | AST_OPT_FLAG_NO_COLOR);
xarg = ast_strdupa(optarg);
break;
More information about the asterisk-commits
mailing list