Re: Ending up with Zombie process



On Mon, 30 Jan 2006 11:08:12 +0100
"Eisenknapp, Josef" <josef eisenknapp siemens com> wrote:

Hello again
The more complex my program is, the more questions i have :-)
I know what you mean. :-)

   sub watch_callback{

   print "callback called\n";
   my ($fh) = @_;

   my $line;
   $fh->sysread($line,1000);
   chomp $line;
   if($line){
         print $line. "\n";
   }
   else{
            
            1 while wait != -1 ;  # avoid zombies

         print "remove helper\n";
         Gtk2::Helper->remove_watch($helper_tag);
   }

   return TRUE;
   }

This works pretty fine, but when the process "write_to_fff.pl"
terminates it becomes a ZOMBI.

Can anyone tell me how to avoid this?

Add  
    1 while wait != -1 ;  # avoid zombies
at the point indicated above.


-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]