From: Dan Boger <zigdon@irc.peeron.com>
Date: Mon, 5 Oct 2009 19:40:17 +0000 (-0700)
Subject: Try harder to make sure we don't leave zombies around
X-Git-Url: https://git.sommitrealweird.co.uk/twirssi-net-twitter-lite.git/commitdiff_plain/2e429a4df13a8c333a82c6ecf582b30858a207f0?ds=sidebyside;hp=0c9ff87addaabcd2f252b04b192dfe63777a2935

Try harder to make sure we don't leave zombies around
---

diff --git a/twirssi.pl b/twirssi.pl
index d894a36..8f1801f 100644
--- a/twirssi.pl
+++ b/twirssi.pl
@@ -1403,6 +1403,9 @@ sub monitor_child {
             # make sure the pid is removed from the waitpid list
             Irssi::pidwait_remove($child_pid);
 
+            # and that we don't leave any zombies behind, somehow
+            wait();
+
             # save id_map hash
             if ( keys %id_map
                 and my $file =
@@ -1429,6 +1432,7 @@ sub monitor_child {
     } else {
         print "Giving up on polling $filename" if &debug;
         Irssi::pidwait_remove($child_pid);
+        wait();
         unlink $filename unless &debug;
 
         return unless Irssi::settings_get_bool("twirssi_notify_timeouts");