Permalink
Browse files

update signal handlers to match new usage

  • Loading branch information...
1 parent 70fd464 commit d651b5705ac5758c01b15d2359eedf9e57d7c468 @rcaputo committed Aug 26, 1998
Showing with 7 additions and 1 deletion.
  1. +2 −0 samples/forkbomb.perl
  2. +3 −0 samples/selects.perl
  3. +2 −1 samples/signals.perl
@@ -45,11 +45,13 @@ sub forkbomb {
my ($k, $me, $from, $state, @etc) = @_;
print $me->{'id'}, ": _default got state ($state) from ($from) ",
"parameters(", join(', ', @etc), ")\n";
+ return 0;
},
'signal handler' => sub
{
my ($k, $me, $from, $signal) = @_;
print $me->{'id'}, ": caught SIG$signal\n";
+ return 0;
},
'fork' => sub
{
@@ -54,6 +54,7 @@
my ($k, $me, $from, $state, @etc) = @_;
print "Chargen server _default got state ($state) from ($from) ",
"parameters(", join(', ', @etc), ")\n";
+ return 0;
},
# start soft states
'accept' => sub
@@ -84,6 +85,7 @@
my ($k, $me, $from, $state, @etc) = @_;
print "Chargen service _default got state ($state) from ($from) ",
"parameters(", join(', ', @etc), ")\n";
+ return 0;
},
# consume anything sent
'read' => sub {
@@ -167,6 +169,7 @@
my ($k, $me, $from, $state, @etc) = @_;
print "Chargen client _default got state ($state) from ($from) ",
"parameters(", join(', ', @etc), ")\n";
+ return 0;
},
'_child' => sub
{
@@ -16,7 +16,7 @@
{
my ($k, $me, $from) = @_;
$k->sig('INT', 'signal handler');
- print "Signal watcher started. Send SIGINT: ";
+ print "Signal watcher started. Send SIGINT or SIGTERM: ";
$k->post($me, 'set an alarm');
},
'_stop' => sub
@@ -29,6 +29,7 @@
my ($k, $me, $from, $state, @etc) = @_;
print "Signal watcher _default gets state ($state) from ($from) ",
"parameters(", join(', ', @etc), ")\n";
+ return 0;
},
'set an alarm' => sub
{

0 comments on commit d651b57

Please sign in to comment.