projects
/
twirssi-net-twitter-lite.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4b6615e
)
Make sure we don't leave pids in the pidwait_*() list once we're done with our forked...
author
Dan Boger
<zigdon@irc.peeron.com>
Tue, 1 Sep 2009 19:02:55 +0000
(12:02 -0700)
committer
Dan Boger
<zigdon@irc.peeron.com>
Tue, 1 Sep 2009 19:02:55 +0000
(12:02 -0700)
twirssi.pl
patch
|
blob
|
history
diff --git
a/twirssi.pl
b/twirssi.pl
index 1263893633ca3fd0eaf3e0504c056bbf56b8f0fc..eb878bf205db717e4a49b7abeec4bbb4c712e11e 100644
(file)
--- a/
twirssi.pl
+++ b/
twirssi.pl
@@
-38,6
+38,7
@@
my %tweet_cache;
my %id_map;
my $failwhale = 0;
my $first_call = 1;
my %id_map;
my $failwhale = 0;
my $first_call = 1;
+my $child_pid;
my %irssi_to_mirc_colors = (
'%k' => '01',
my %irssi_to_mirc_colors = (
'%k' => '01',
@@
-776,13
+777,13
@@
sub get_updates {
my ( $fh, $filename ) = File::Temp::tempfile();
binmode( $fh, ":utf8" );
my ( $fh, $filename ) = File::Temp::tempfile();
binmode( $fh, ":utf8" );
-
my $
pid = fork();
+
$child_
pid = fork();
- if ($pid) { # parent
+ if ($
child_
pid) { # parent
Irssi::timeout_add_once( 5000, 'monitor_child',
[ "$filename.done", 0 ] );
Irssi::timeout_add_once( 5000, 'monitor_child',
[ "$filename.done", 0 ] );
- Irssi::pidwait_add($pid);
- } elsif ( defined $pid ) { # child
+ Irssi::pidwait_add($
child_
pid);
+ } elsif ( defined $
child_
pid ) { # child
close STDIN;
close STDOUT;
close STDERR;
close STDIN;
close STDOUT;
close STDERR;
@@
-1222,6
+1223,9
@@
sub monitor_child {
delete $tweet_cache{$_};
}
$last_poll = $new_last_poll;
delete $tweet_cache{$_};
}
$last_poll = $new_last_poll;
+
+ # make sure the pid is removed from the waitpid list
+ Irssi::pidwait_remove($child_pid);
# save id_map hash
if ( keys %id_map
# save id_map hash
if ( keys %id_map