mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:35:06 -05:00
client: improve signal handling
After receiving a signal, don't process new command from readline() and break from waitsync command.
This commit is contained in:
4
client.c
4
client.c
@@ -2341,7 +2341,7 @@ process_cmd_waitsync(char *line)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ret && (!max_tries || i < max_tries)) {
|
if (!ret && (!max_tries || i < max_tries) && !quit) {
|
||||||
sleep(10);
|
sleep(10);
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
@@ -2729,7 +2729,7 @@ main(int argc, char **argv)
|
|||||||
} else {
|
} else {
|
||||||
do {
|
do {
|
||||||
line = read_line();
|
line = read_line();
|
||||||
if (line) {
|
if (line && !quit) {
|
||||||
ret = process_line(line);
|
ret = process_line(line);
|
||||||
}else {
|
}else {
|
||||||
/* supply the final '\n' when user exits via ^D */
|
/* supply the final '\n' when user exits via ^D */
|
||||||
|
|||||||
Reference in New Issue
Block a user