]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
client: improve signal handling
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 29 Sep 2015 15:11:38 +0000 (17:11 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 29 Sep 2015 16:05:50 +0000 (18:05 +0200)
After receiving a signal, don't process new command from readline() and
break from waitsync command.

client.c

index ea47582b6e4d59722a6852269e32208c15c8b775..a02da4d0d85df015579493ad61d630e480111531 100644 (file)
--- 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 */