On Fri, Nov 09, 2007 at 04:41:22PM +0100, Michael Gebetsroither wrote:
> Package: libterm-readkey-perl
> Version: 2.30-3
> Severity: normal

> while (not defined ($x = ReadKey(0))) {}
> 
> The real problem is, that after starting start-x and returning, the cpu
> runs at 100% because ReadKey does not block anymore and returnes
> undefined value all of the time.

Hi,

the child process is probably setting O_NONBLOCK on STDIN.
Does it help if you do something like

 use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);

 $flags = fcntl(STDIN, F_GETFL, 0)
 or die "Can't get flags for STDIN: $!\n";

 $flags = fcntl(STDIN, F_SETFL, $flags & ~O_NONBLOCK)
 or die "Can't set flags for STDIN: $!\n";

after the child process has returned?

Cheers,
-- 
Niko Tyni   [EMAIL PROTECTED]



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to