main: fix -q option

Attempting to step the system clock by using the -q option with chronyd
would fail.
This commit is contained in:
Bryan Christianson 2017-07-31 22:19:22 +12:00 committed by Miroslav Lichvar
parent d70df3daab
commit 4f1fc1ee78

7
main.c
View file

@ -448,8 +448,13 @@ int main
sched_priority = parse_int_arg(optarg); sched_priority = parse_int_arg(optarg);
break; break;
case 'q': case 'q':
ref_mode = REF_ModeUpdateOnce;
nofork = 1;
client_only = 0;
system_log = 0;
break;
case 'Q': case 'Q':
ref_mode = opt == 'q' ? REF_ModeUpdateOnce : REF_ModePrintOnce; ref_mode = REF_ModePrintOnce;
nofork = 1; nofork = 1;
client_only = 1; client_only = 1;
clock_control = 0; clock_control = 0;