Req #72409 [NEW]: pcntl_signal function could return previous value of the signal handler

From: Date: Wed, 15 Jun 2016 09:06:36 +0000
Subject: Req #72409 [NEW]: pcntl_signal function could return previous value of the signal handler
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201637@lists.php.net to get a copy of this message
From: jan dot kahoun at heureka dot cz Operating system: PHP version: Irrelevant Package: PCNTL related Bug Type: Feature/Change Request Bug description:pcntl_signal function could return previous value of the signal handler Description: ------------ This function could be similar to C signal() function (http://www.gnu.org/software/libc/manual/html_node/Basic-Signal-Handling.html) and return the previous value of the signal handler for passed signal, or false on error. This can be helpfull when you need to restore previous handler Test script: --------------- <?php declare(ticks = 1); function sig_handler($signo) { switch ($signo) { case SIGTERM: exit; break; default: } } // this will return previous handler for SIGTERM signal $previous_handler = pcntl_signal(SIGTERM, "sig_handler"); // restore previous handler $previous_handler = pcntl_signal(SIGTERM, $previous_handler); Expected result: ---------------- function pcntl_signal() returns previous value of the signal handler for passed signal on success or FALSE on failure Actual result: -------------- function pcntl_signal() returns TRUE on success or FALSE on failure -- Edit bug report at https://bugs.php.net/bug.php?id=72409&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72409&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72409&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72409&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=72409&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=72409&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=72409&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=72409&r=needscript Try newer version: https://bugs.php.net/fix.php?id=72409&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=72409&r=support Expected behavior: https://bugs.php.net/fix.php?id=72409&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=72409&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=72409&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=72409&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72409&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=72409&r=dst IIS Stability: https://bugs.php.net/fix.php?id=72409&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=72409&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=72409&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=72409&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=72409&r=mysqlcfg

« previous php.bugs (#201637) next »