[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-commit
Subject:    r1590 - trunk/varnish-cache/bin/varnishstat
From:       des () projects ! linpro ! no (des at projects ! linpro ! no)
Date:       2007-06-28 12:07:51
Message-ID: 20070628120751.D42F21EC030 () projects ! linpro ! no
[Download RAW message or body]

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;
 		}
 	}



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic