summaryrefslogtreecommitdiff
blob: fe364b0b085acd13a9e5b8aa2afe35ab9ca4e8ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
diff -uNr partimage-0.6.6.orig/src/server/partimaged-main.cpp partimage-0.6.6/src/server/partimaged-main.cpp
--- partimage-0.6.6.orig/src/server/partimaged-main.cpp	2006-04-22 16:24:14.000000000 +0200
+++ partimage-0.6.6/src/server/partimaged-main.cpp	2008-01-14 23:30:21.000000000 +0100
@@ -98,6 +98,11 @@
   else if (signo == SIGINT)
     {
       g_bSigInt = true;
+      delete g_Server;
+      delete g_Window;
+      g_Server = NULL;
+      g_Window = NULL;
+      exit(0);
     }
   else if (signo == SIGSEGV)
     {
@@ -235,7 +240,7 @@
 	  case 'd':
 	    if (chdir(optarg) != 0)
 	    {
-		    printf("%s: %s\n", optarg, strerror(errno));
+		    printf("Directory %s: %s\n", optarg, strerror(errno));
 		    exit(-1);
 	    }
 	    break;
@@ -313,9 +318,9 @@
 #endif    
 
   // register signals
-//  signal(SIGTERM, catch_sigint);
-//  signal(SIGINT, catch_sigint);
-//  signal(SIGSEGV, catch_sigint); // segmentation fault
+  signal(SIGTERM, catch_sigint);
+  signal(SIGINT, catch_sigint);
+  signal(SIGSEGV, catch_sigint); // segmentation fault
 //  signal(SIGHUP, catch_sigint);
 //  signal(SIGQUIT, catch_sigint);
 //  signal(SIGCHLD, catch_sigint);