From e81c81a5bbf98bb777f7f630f1653f3c9addc12b Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 11 Jul 2008 20:19:20 +0000 Subject: [PATCH] -Fix problem where copycds would not umount correctly git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1872 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/copycds.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/copycds.pm b/xCAT-server/lib/xcat/plugins/copycds.pm index d16af1724..06894e3a6 100644 --- a/xCAT-server/lib/xcat/plugins/copycds.pm +++ b/xCAT-server/lib/xcat/plugins/copycds.pm @@ -5,6 +5,7 @@ use xCAT::Table; use Data::Dumper; use Getopt::Long; use File::Basename; +use Cwd; Getopt::Long::Configure("bundling"); Getopt::Long::Configure("pass_through"); @@ -34,6 +35,7 @@ sub process_request { my $arch = undef; $identified=0; $::CDMOUNTPATH="/mnt/xcat"; + my $existdir = getcwd; @ARGV = @{$request->{arg}}; GetOptions( @@ -94,6 +96,8 @@ sub process_request { $doreq->($newreq,\&take_answer); $::CDMOUNTPATH=""; + chdir($existdir); + while (wait() > 0) { yield; } #Make sure all children exit before trying umount system("umount /mnt/xcat"); unless ($identified) { $callback->({error=>["copycds could not identify the ISO supplied, you may wish to try -n "],errorcode=>[1]});