From 602e91700b14901519002d52211ea07e5c72192c Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 8 Jun 2011 18:46:01 +0000 Subject: [PATCH] Shave a few more milliseconds off profiling by using seemingly faster non-OO style autoflush syntax git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9767 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatd | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 334ca5927..83bd2e0e7 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -63,7 +63,7 @@ unless ($inet6support) { my $dispatch_requests = 1; # govern whether commands are dispatchable use IO::Socket; -use IO::Handle; +#use IO::Handle; use IO::Select; use XML::Simple; $XML::Simple::PREFERRED_PARSER='XML::Parser'; @@ -1020,8 +1020,11 @@ sub plugin_command { die; } #pipe($pfd,$cfd); - $parfd->autoflush(1); - $pfd->autoflush(1); + my $oldfh = select $parfd; + $|=1; + select $pfd; + $|=1; + select $oldfh; binmode($parfd,':utf8'); binmode($pfd,':utf8'); $child = xCAT::Utils->xfork; @@ -1243,8 +1246,11 @@ sub dispatch_request { xCAT::MsgUtils->message("S", "ERROR: socketpair: $!"); die; } - $parfd->autoflush(1); - $pfd->autoflush(1); + my $oldfh = select $parfd; + $|=1; + select $pfd; + $|=1; + select $oldfh; binmode($parfd,':utf8'); binmode($pfd,':utf8'); $child = xCAT::Utils->xfork;