Fix a memory leak in the NFS-over-UDP code.
[bluesky.git] / nfs3 / nfsd.c
index b2e1071..fc1f955 100644 (file)
@@ -26,11 +26,20 @@ void register_rpc();
 BlueSkyFS *fs;
 BlueSkyStore *store;
 
+static void shutdown_handler(int num)
+{
+    g_print("SIGINT caught, shutting down...\n");
+    g_print("Proxy statistics:\n");
+    bluesky_stats_dump_all();
+    exit(1);
+}
+
 int main(int argc, char *argv[])
 {
     int i;
 
     signal(SIGPIPE, SIG_IGN);
+    signal(SIGINT, shutdown_handler);
 
     bluesky_init();
     g_set_prgname("nfsd");