Replaced usage of variable 'print_level'
with struct config item 'logging_level'. Original variable still used for
range checking.

Signed-off-by: Peter Schneider <pe...@psch.de>
---
 phc2sys.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/phc2sys.c b/phc2sys.c
index dc7cb28..7d5edad 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -1481,8 +1481,10 @@ int main(int argc, char *argv[])
                        break;
                case 'l':
                        if (get_arg_val_i(c, optarg, &print_level,
-                                         PRINT_LEVEL_MIN, PRINT_LEVEL_MAX))
+                                         PRINT_LEVEL_MIN, PRINT_LEVEL_MAX) ||
+                           config_set_int(cfg, "logging_level", print_level)) {
                                goto end;
+                       }
                        break;
                case 't':
                        message_tag = optarg;
@@ -1532,7 +1534,7 @@ int main(int argc, char *argv[])
        print_set_tag(message_tag);
        print_set_verbose(verbose);
        print_set_syslog(use_syslog);
-       print_set_level(print_level);
+       print_set_level(config_get_int(cfg, NULL, "logging_level"));
 
        if (autocfg) {
                if (init_pmc(cfg, &node))
-- 
2.14.3


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to