]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Really fix the "core set debug" and "core set verbose" CLI commands.
authorRussell Bryant <russell@russellbryant.com>
Sat, 4 Nov 2006 17:59:39 +0000 (17:59 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 4 Nov 2006 17:59:39 +0000 (17:59 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@47195 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/asterisk.c
main/cli.c

index 22ee7e9abbd508e93b2db4eb9b7daadfb5370be0..4ca646a5586830fcd9c1190083836378a5bb5964 100644 (file)
@@ -2142,9 +2142,9 @@ static void ast_remotecontrol(char * data)
                pid = atoi(cpid);
        else
                pid = -1;
-       snprintf(tmp, sizeof(tmp), "core verbose atleast %d", option_verbose);
+       snprintf(tmp, sizeof(tmp), "core set verbose atleast %d", option_verbose);
        fdprint(ast_consock, tmp);
-       snprintf(tmp, sizeof(tmp), "core debug atleast %d", option_debug);
+       snprintf(tmp, sizeof(tmp), "core set debug atleast %d", option_debug);
        fdprint(ast_consock, tmp);
        if (ast_opt_mute) {
                snprintf(tmp, sizeof(tmp), "log and verbose output currently muted ('logger unmute' to unmute)");
index e8f4d3b165101170a7f10035252462ce6958134d..64ee53bea66d80c50b8c1c81820d015dd461302a 100644 (file)
@@ -205,22 +205,22 @@ static int handle_verbose(int fd, int argc, char *argv[])
        int newlevel;
        int atleast = 0;
 
-       if ((argc < 3) || (argc > 4))
+       if ((argc < 4) || (argc > 5))
                return RESULT_SHOWUSAGE;
 
        if (!strcasecmp(argv[3], "atleast"))
                atleast = 1;
 
        if (!atleast) {
-               if (argc > 3)
+               if (argc > 4)
                        return RESULT_SHOWUSAGE;
 
-               option_verbose = atoi(argv[2]);
+               option_verbose = atoi(argv[3]);
        } else {
-               if (argc < 4)
+               if (argc < 5)
                        return RESULT_SHOWUSAGE;
 
-               newlevel = atoi(argv[3]);
+               newlevel = atoi(argv[4]);
                if (newlevel > option_verbose)
                        option_verbose = newlevel;
         }
@@ -270,32 +270,32 @@ static int handle_debug(int fd, int argc, char *argv[])
        int atleast = 0;
        char *filename = '\0';
 
-       if ((argc < 3) || (argc > 5))
+       if ((argc < 4) || (argc > 6))
                return RESULT_SHOWUSAGE;
 
        if (!strcasecmp(argv[3], "atleast"))
                atleast = 1;
 
        if (!atleast) {
-               if (argc > 4)
+               if (argc > 5)
                        return RESULT_SHOWUSAGE;
 
-               if (sscanf(argv[2], "%d", &newlevel) != 1)
+               if (sscanf(argv[3], "%d", &newlevel) != 1)
                        return RESULT_SHOWUSAGE;
 
-               if (argc == 3) {
+               if (argc == 4) {
                        debug_filename[0] = '\0';
                } else {
-                       filename = argv[3];
+                       filename = argv[4];
                        ast_copy_string(debug_filename, filename, sizeof(debug_filename));
                }
 
                option_debug = newlevel;
        } else {
-               if (argc < 4)
+               if (argc < 5 || argc > 6)
                        return RESULT_SHOWUSAGE;
 
-               if (sscanf(argv[3], "%d", &newlevel) != 1)
+               if (sscanf(argv[4], "%d", &newlevel) != 1)
                        return RESULT_SHOWUSAGE;
 
                if (argc == 4) {