From 61df2a6c51e4b8df323e1b2e48d9d4162029abcc Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Thu, 17 Jan 2013 21:05:46 +0100 Subject: [PATCH] Trap SIGINT to unmount to temporary mount point This makes END being called again after Ctrl-C. --- bin/xen-create-image | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/xen-create-image b/bin/xen-create-image index dac602e..76a1dc8 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -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; -- 2.39.5