Permalink
Browse files

Forking adding of nicks

  • Loading branch information...
1 parent ea2cfee commit eb81746ef7440fe9c26eac2396c31f91a26785f5 IsaacG committed with Aug 10, 2011
Showing with 13 additions and 2 deletions.
  1. +13 −2 stalker.pl
View
@@ -114,11 +114,22 @@ sub channel_sync {
my ( $channel ) = @_;
my $serv = $channel->{server}->{address};
-
+
+ my $pid = fork();
+ if ( ! defined( $pid ) ) {
+ debugPrint("crit", "fork() failed. aborting channel sync.";
+ return;
+ }
+ return if ($pid > 0); # Parent
+
+
+ # Child does the adding
for my $nick ( $channel->nicks() ) {
last if $nick->{host} eq ''; # Sometimes channel sync doesn't give us this...
add_record( $nick->{nick}, ( split( '@', $nick->{host} ) ), $serv );
- }
+ }
+
+ POSIX::_exit(1);
}

0 comments on commit eb81746

Please sign in to comment.