r1590 - trunk/varnish-cache/bin/varnishstat

des at projects.linpro.no des at projects.linpro.no
Thu Jun 28 14:07:51 CEST 2007


Author: des
Date: 2007-06-28 14:07:51 +0200 (Thu, 28 Jun 2007)
New Revision: 1590

Modified:
   trunk/varnish-cache/bin/varnishstat/varnishstat.c
Log:
Handle Ctrl-Z and Ctrl-T.


Modified: trunk/varnish-cache/bin/varnishstat/varnishstat.c
===================================================================
--- trunk/varnish-cache/bin/varnishstat/varnishstat.c	2007-06-28 10:29:27 UTC (rev 1589)
+++ trunk/varnish-cache/bin/varnishstat/varnishstat.c	2007-06-28 12:07:51 UTC (rev 1590)
@@ -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 @@
 		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;
 		}
 	}




More information about the varnish-commit mailing list