in reply to Re: Killing child process
in thread Killing child process
Is there a bug in this code, or are things not working as documented?#!/usr/bin/perl -w use strict; $SIG{TERM}= sub { print "TERM $$\n"; exit(1); }; if (my $kidpid = fork) { # Parent sleep(1); print "\n"; kill -15, $kidpid; sleep(5); } else { print "CREATED CHILD $$\n"; # Child for my $i (1..10) { if (!fork) { # Grandchild print "CREATED GRANDCHILD $$\n"; sleep(5); exit(0); } } sleep(300); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Killing child process
by Thelonius (Priest) on Oct 13, 2003 at 02:20 UTC | |
by sgifford (Prior) on Oct 13, 2003 at 03:31 UTC | |
|
Re: Re: Re: Killing child process
by pg (Canon) on Oct 12, 2003 at 17:02 UTC | |
by sgifford (Prior) on Oct 12, 2003 at 17:42 UTC |