fix the error that handle the return code when initiate the syncfile

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7121 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
daniceexi 2010-08-18 03:21:19 +00:00
parent f3537cda29
commit a0e5597593

View File

@ -31,18 +31,20 @@ print $remote "</xcatrequest>\n";
my $response='';
my $rsp;
my $rc;
while (<$remote>) {
$response .= $_;
if ($response =~ m/<\/xcatresponse>/) {
$rsp = eval { XMLin($response,SuppressEmpty=>undef,ForceArray=>1) };
if ($rsp->{serverdone}) {
close $remote;
exit 1;
exit !$rc;
}
if ($rsp->{errorcode} || $rsp->{error}) {
close $remote;
exit 0;
if ($rsp->{errorcode}) {
$rc = $rsp->{errorcode}[0];
} elsif ($rsp->{error}) {
$rc = $rsp->{error}[0];
}
$response='';
}