]> xenbits.xensource.com Git - people/dariof/xen-tools.git/commitdiff
Trap SIGINT to unmount to temporary mount point
authorAxel Beckert <abe@deuxchevaux.org>
Thu, 17 Jan 2013 20:05:46 +0000 (21:05 +0100)
committerAxel Beckert <abe@deuxchevaux.org>
Thu, 17 Jan 2013 20:16:22 +0000 (21:16 +0100)
This makes END being called again after Ctrl-C.

bin/xen-create-image

index dac602efc51b3b5aaf963eaf50c7e09d2444ec06..76a1dc84a9785bd0ac76267d2c1d229ae2bbd4c6 100755 (executable)
@@ -779,6 +779,7 @@ The LICENSE file contains the full text of the license.
 
 =cut
 
+$SIG{INT} = \&clean_up;
 
 use strict;
 use English;
@@ -4088,6 +4089,13 @@ sub unMountImage
 
 =cut
 
+sub clean_up () {
+    if ( defined($MOUNT_POINT) )
+    {
+        unMountImage($MOUNT_POINT, 1);
+    }
+}
+
 sub END
 {
     exit 0 if $VERSION || $HELP || $MANUAL || $DUMPCONFIG;