2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-22 11:10:24 +00:00

Merge pull request #881 from chenglch/xcatd_relayfds

Do not send warning message as the output is complete
This commit is contained in:
Xiaopeng Wang
2016-03-31 16:56:05 +08:00

View File

@@ -1901,21 +1901,13 @@ sub plugin_command {
$xcatresponses{xcatresponse}=[];
}
}
if ($check_fds->count > 0) {
relay_fds($check_fds,$xcatresponses{xcatresponse});
}
if (scalar(@{$xcatresponses{xcatresponse}})) {
send_response(\%xcatresponses,$sock);
$xcatresponses{xcatresponse}=[];
}
if ($check_fds->count > 0) {
my %resp_timeout = ('errorcode'=>[1],
'data'=>["Warning: Process terminated due to IO timeout, the following output may not complete.\n"]);
push @{$xcatresponses{xcatresponse}},\%resp_timeout;
my $count = scalar(@{$xcatresponses{xcatresponse}});
relay_fds($check_fds,$xcatresponses{xcatresponse});
if (scalar(@{$xcatresponses{xcatresponse}}) != $count) {
send_response(\%xcatresponses,$sock);
$xcatresponses{xcatresponse}=[];
}
}
#while (relay_fds($check_fds,$sock)) {}
# restore the old signal