From: Miroslav Lichvar Date: Tue, 29 Sep 2015 15:11:38 +0000 (+0200) Subject: client: improve signal handling X-Git-Tag: 2.2-pre1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60721d2cc1c09da30b934b7aafabda9d54e2d996;p=thirdparty%2Fchrony.git client: improve signal handling After receiving a signal, don't process new command from readline() and break from waitsync command. --- diff --git a/client.c b/client.c index ea47582b..a02da4d0 100644 --- a/client.c +++ b/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); } else { break; @@ -2729,7 +2729,7 @@ main(int argc, char **argv) } else { do { line = read_line(); - if (line) { + if (line && !quit) { ret = process_line(line); }else { /* supply the final '\n' when user exits via ^D */