]> err.no Git - varnish/commitdiff
Handle Ctrl-Z and Ctrl-T.
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 28 Jun 2007 12:07:51 +0000 (12:07 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 28 Jun 2007 12:07:51 +0000 (12:07 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1590 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishstat/varnishstat.c

index 0d4f1f10f56f6400204905e2ddd95b48e4a64de3..8362f58c3798921517ab55bcf5af2c608b7bb0d0 100644 (file)
@@ -34,6 +34,7 @@
 #include <curses.h>
 #include <errno.h>
 #include <limits.h>
+#include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -142,17 +143,24 @@ do_curses(struct varnish_stats *VSL_stats, int delay)
                case KEY_RESIZE:
                        erase();
                        break;
-               case '\014':
+               case '\014': /* Ctrl-L */
+               case '\024': /* Ctrl-T */
                        redrawwin(stdscr);
                        refresh();
                        break;
                case '\003': /* Ctrl-C */
+                       raise(SIGINT);
+                       break;
+               case '\032': /* Ctrl-Z */
+                       raise(SIGTSTP);
+                       break;
                case '\021': /* Ctrl-Q */
                case 'Q':
                case 'q':
                        endwin();
-                       return;
+                       exit(0);
                default:
+                       beep();
                        break;
                }
        }