]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
main: fix -q option
authorBryan Christianson <bryan@whatroute.net>
Mon, 31 Jul 2017 10:19:22 +0000 (22:19 +1200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 9 Aug 2017 07:57:13 +0000 (09:57 +0200)
Attempting to step the system clock by using the -q option with chronyd
would fail.

main.c

diff --git a/main.c b/main.c
index 5c6a28174e73b753d303c9d56a0cc9fcbed17819..b93a8835330874cbcbdf8ed022fb8bd7a032f987 100644 (file)
--- a/main.c
+++ b/main.c
@@ -448,8 +448,13 @@ int main
         sched_priority = parse_int_arg(optarg);
         break;
       case 'q':
+        ref_mode = REF_ModeUpdateOnce;
+        nofork = 1;
+        client_only = 0;
+        system_log = 0;
+        break;
       case 'Q':
-        ref_mode = opt == 'q' ? REF_ModeUpdateOnce : REF_ModePrintOnce;
+        ref_mode = REF_ModePrintOnce;
         nofork = 1;
         client_only = 1;
         clock_control = 0;