diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2013-02-14 11:02:09 +0100 |
---|---|---|
committer | Jan Schmidt <janosch@webgods.de> | 2013-02-25 10:25:07 +0100 |
commit | c0904742dc1e338b1942a61e6e3d86ead90f3452 (patch) | |
tree | b0eb6108ef07aa7083ba8f1307968161b2b30de2 | |
parent | 678074a115ffc22c14054a4d2029a15f85b720b0 (diff) | |
download | far-progs-c0904742dc1e338b1942a61e6e3d86ead90f3452.tar.gz |
far-progs: remove temp files on interrupt unless -k
-rwxr-xr-x | test.pl | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -247,7 +247,19 @@ if ($src_type eq "zfs") { die; } +sub cleanup_temp { + if (!$keep_temp) { + ignore_local("umount", $dst_mnt); + ignore_remote("umount", $src_mnt); + ignore_local("rm", "-rf", $p_fardir); + if ($remote_host) { + ignore_remote("rm", "-rf", $p_fardir); + } + } +} + sub cleanup { + cleanup_temp(); if ($ssh_chld) { kill "TERM", $ssh_chld; unlink $ssh_socket; @@ -430,15 +442,6 @@ if (@failed_tests) { print "\nAll tests ok\n"; } -if (!$keep_temp) { - do_local("umount", $dst_mnt); - do_remote("umount", $src_mnt); - do_local("rm", "-rf", $p_fardir); - if ($remote_host) { - do_remote("rm", "-rf", $p_fardir); - } -} - exit($ex_ret); END { |