Bug 122391 - Polling pipes fails on Fedora. Example provided
Polling pipes fails on Fedora. Example provided
Product: Fedora
Classification: Fedora
Component: perl-DBI (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Warren Togami
Depends On:
  Show dependency treegraph
Reported: 2004-05-03 18:46 EDT by Ray Gwinn
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-04-17 13:24:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ray Gwinn 2004-05-03 18:46:46 EDT
Polling pipes does not seem to work correctly on Fedora 1.  Two perl
scripts follow that demonstrate the problem.

The below scripts work on all distros that I have tested, including 
RH9, but fails on Fedora 1.  I have not tried the test Fedora 2.


#!/usr/local/bin/perl -w
# This script is called "test.pl" and is run in the pipe.

use strict;
$| = 1;

print "out1\n";
sleep 3;
print "out2\n";
sleep 3;
print "out3\n";
sleep 3;
print "out4\n";

Following is a script that invokes the above script.

#!/usr/local/bin/perl -w
# This script polls a command pipe by checking the filesize
# of the pipe's file handle.
use Tk;
use strict;

my $MW = MainWindow->new;
my $txt = $MW->Text->pack;

open (MY_PIPE, "test.pl |") or die "Couldn't open: $!\n";
my $pipe = \*MY_PIPE;

$MW->repeat(50 => \&read_pipe);


sub read_pipe {
   # Read from the pipe if data is present there.
   my $size = -s $pipe;
   if ($size) {
      my $line;
      return unless $line;
      $txt->insert('end', "$line");
Comment 1 Ray Gwinn 2004-05-11 12:01:40 EDT
I have now tested the pipe polling problem on Fedora 2, test 3.  The 
problem still exists.

Comment 2 Warren Togami 2005-09-08 23:13:35 EDT
What about FC4?

Note You need to log in before you can comment on or make changes to this bug.