Re: pcntl_signal problem
| From: | Edin Kadribasic | Date: | Fri, 25 Oct 2002 13:50:26 +0000 |
| Subject: | Re: pcntl_signal problem | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-90113@lists.php.net to get a copy of this message | ||
There were some changes to the pcntl extension. Have a look at
http://www.zend.com/lists/php-dev/200208/msg00937.html
Edin
----- Original Message -----
From: "Steve Alberty" <staybyte@php.net>
To: <php-dev@lists.php.net>
Sent: Friday, October 25, 2002 2:35 PM
Subject: [PHP-DEV] pcntl_signal problem
>
> Hi,
>
> i've a small problem with the signal handler.
>
> These short script demonstrate my problem.
>
> #!/usr/local/bin/php
> <?php
>
> set_time_limit(0);
>
> function signals($signo) {
>
> switch($signo) {
> case SIGTERM:
> echo "Termination signal";
> exit;
> break;
> case SIGINT:
> echo "Interrupt from keyboard";
> exit
> break;
> }
> }
>
> $result=pcntl_signal(SIGTERM, 'signals');
> if ($result == false) echo 'could not install sighandler for TERM';
> $result=pcntl_signal(SIGINT, 'signals');
> if ($result == false) echo 'could not install sighandler for INT';
>
> echo "goto loop ...\n";
> $c=0;
> while (true){
> $c++;
> usleep(1);
> }
> ?>
>
> The problem is, that the script doesnt exit when i'm
> sending the TERM signal or pressing CTRL-C (INT signal).
>
> I've test it with the lastest cvs version.
>
> Any help?
>
> Regards,
>
> Steve
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>