From 3f6118dae132b16876582223af5a42756628467d Mon Sep 17 00:00:00 2001 From: sjing Date: Tue, 18 Dec 2012 08:53:57 +0000 Subject: [PATCH] keep the parent_fd before any change, then restore it after the change, since it's a global variable. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14676 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index f71d4faf4..0628022ab 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -1218,6 +1218,7 @@ sub plugin_command { # $req->{sequential} is 0 by default if (defined($req->{sequential}) && $req->{sequential}->[0]) { # PCM case, executing plugins sequentially in alphabetic order + my $old_parent_fd = $parent_fd; $parent_fd = 0; foreach (sort(keys %handler_hash)) { my $modname = $_; @@ -1267,6 +1268,7 @@ sub plugin_command { } push @{$xcatresponses{xcatresponse}}, $Main::resps; } + $parent_fd = $old_parent_fd; } else { # executing plugins parallel foreach (keys %handler_hash) { @@ -1304,6 +1306,7 @@ sub plugin_command { if ($parfd) { #If xCAT is doing multiple requests in same communication PID, things would get unfortunate otherwise $parent_fd = $parfd; } + my $org_parent_fd = $parent_fd; my $oldprogname=$$progname; $$progname=$oldprogname.": $modname instance"; if ($sock) { close $pfd; } @@ -1322,6 +1325,7 @@ sub plugin_command { ${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request); } $$progname=$oldprogname; + $parent_fd = $org_parent_fd; if ($sock) { close($parent_fd); xexit(0);