mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Fix a bug with the removal of 'atleast' argument to 'core verbose' and 'core debug'.
Add that argument back in. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@44053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2138,9 +2138,9 @@ static void ast_remotecontrol(char * data)
|
|||||||
pid = atoi(cpid);
|
pid = atoi(cpid);
|
||||||
else
|
else
|
||||||
pid = -1;
|
pid = -1;
|
||||||
snprintf(tmp, sizeof(tmp), "core verbose %d", option_verbose);
|
snprintf(tmp, sizeof(tmp), "core verbose atleast %d", option_verbose);
|
||||||
fdprint(ast_consock, tmp);
|
fdprint(ast_consock, tmp);
|
||||||
snprintf(tmp, sizeof(tmp), "core debug %d", option_debug);
|
snprintf(tmp, sizeof(tmp), "core debug atleast %d", option_debug);
|
||||||
fdprint(ast_consock, tmp);
|
fdprint(ast_consock, tmp);
|
||||||
if (ast_opt_mute) {
|
if (ast_opt_mute) {
|
||||||
snprintf(tmp, sizeof(tmp), "log and verbose output currently muted ('logger unmute' to unmute)");
|
snprintf(tmp, sizeof(tmp), "log and verbose output currently muted ('logger unmute' to unmute)");
|
||||||
|
55
main/cli.c
55
main/cli.c
@@ -236,12 +236,28 @@ static int handle_set_verbose_deprecated(int fd, int argc, char *argv[])
|
|||||||
static int handle_verbose(int fd, int argc, char *argv[])
|
static int handle_verbose(int fd, int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int oldval = option_verbose;
|
int oldval = option_verbose;
|
||||||
|
int newlevel;
|
||||||
|
int atleast = 0;
|
||||||
|
|
||||||
if (argc == 3)
|
if ((argc < 3) || (argc > 4))
|
||||||
option_verbose = atoi(argv[2]);
|
|
||||||
else
|
|
||||||
return RESULT_SHOWUSAGE;
|
return RESULT_SHOWUSAGE;
|
||||||
|
|
||||||
|
if (!strcasecmp(argv[2], "atleast"))
|
||||||
|
atleast = 1;
|
||||||
|
|
||||||
|
if (!atleast) {
|
||||||
|
if (argc > 3)
|
||||||
|
return RESULT_SHOWUSAGE;
|
||||||
|
|
||||||
|
option_verbose = atoi(argv[2]);
|
||||||
|
} else {
|
||||||
|
if (argc < 4)
|
||||||
|
return RESULT_SHOWUSAGE;
|
||||||
|
|
||||||
|
newlevel = atoi(argv[3]);
|
||||||
|
if (newlevel > option_verbose)
|
||||||
|
option_verbose = newlevel;
|
||||||
|
}
|
||||||
if (oldval > 0 && option_verbose == 0)
|
if (oldval > 0 && option_verbose == 0)
|
||||||
ast_cli(fd, "Verbosity is now OFF\n");
|
ast_cli(fd, "Verbosity is now OFF\n");
|
||||||
else if (option_verbose > 0) {
|
else if (option_verbose > 0) {
|
||||||
@@ -285,21 +301,46 @@ static int handle_debug(int fd, int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
int oldval = option_debug;
|
int oldval = option_debug;
|
||||||
int newlevel;
|
int newlevel;
|
||||||
|
int atleast = 0;
|
||||||
char *filename = '\0';
|
char *filename = '\0';
|
||||||
|
|
||||||
if ((argc < 3) || (argc > 4))
|
if ((argc < 3) || (argc > 5))
|
||||||
|
return RESULT_SHOWUSAGE;
|
||||||
|
|
||||||
|
if (!strcasecmp(argv[2], "atleast"))
|
||||||
|
atleast = 1;
|
||||||
|
|
||||||
|
if (!atleast) {
|
||||||
|
if (argc > 4)
|
||||||
return RESULT_SHOWUSAGE;
|
return RESULT_SHOWUSAGE;
|
||||||
|
|
||||||
if (sscanf(argv[2], "%d", &newlevel) != 1)
|
if (sscanf(argv[2], "%d", &newlevel) != 1)
|
||||||
return RESULT_SHOWUSAGE;
|
return RESULT_SHOWUSAGE;
|
||||||
|
|
||||||
option_debug = newlevel;
|
if (argc == 3) {
|
||||||
|
debug_filename[0] = '\0';
|
||||||
if (argc == 4) {
|
} else {
|
||||||
filename = argv[3];
|
filename = argv[3];
|
||||||
ast_copy_string(debug_filename, filename, sizeof(debug_filename));
|
ast_copy_string(debug_filename, filename, sizeof(debug_filename));
|
||||||
|
}
|
||||||
|
|
||||||
|
option_debug = newlevel;
|
||||||
} else {
|
} else {
|
||||||
|
if (argc < 4)
|
||||||
|
return RESULT_SHOWUSAGE;
|
||||||
|
|
||||||
|
if (sscanf(argv[3], "%d", &newlevel) != 1)
|
||||||
|
return RESULT_SHOWUSAGE;
|
||||||
|
|
||||||
|
if (argc == 4) {
|
||||||
debug_filename[0] = '\0';
|
debug_filename[0] = '\0';
|
||||||
|
} else {
|
||||||
|
filename = argv[4];
|
||||||
|
ast_copy_string(debug_filename, filename, sizeof(debug_filename));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newlevel > option_debug)
|
||||||
|
option_debug = newlevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldval > 0 && option_debug == 0)
|
if (oldval > 0 && option_debug == 0)
|
||||||
|
Reference in New Issue
Block a user