mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 03:45:07 -05:00
client: fix parsing of -v command option
The sources and sourcestats commands accept -v as an option, but the glibc implementation of getopt() reorders the arguments and parses the option as a command-line option of chronyc. Add '+' to the getopt string to disable this feature. Other getopt() implementations should consider it a new command-line option, which will be handled as an error if present.
This commit is contained in:
2
client.c
2
client.c
@@ -3143,7 +3143,7 @@ main(int argc, char **argv)
|
|||||||
optind = 1;
|
optind = 1;
|
||||||
|
|
||||||
/* Parse short command-line options */
|
/* Parse short command-line options */
|
||||||
while ((opt = getopt(argc, argv, "46acdf:h:mnp:v")) != -1) {
|
while ((opt = getopt(argc, argv, "+46acdf:h:mnp:v")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case '4':
|
case '4':
|
||||||
case '6':
|
case '6':
|
||||||
|
|||||||
Reference in New Issue
Block a user