php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #72409
Patch return-previous-handler revision 2016-06-18 08:20 UTC by dave at mudsite dot com
revision 2016-06-18 08:14 UTC by dave at mudsite dot com
revision 2016-06-18 08:11 UTC by dave at mudsite dot com

Patch return-previous-handler for PCNTL related Bug #72409

Patch version 2016-06-18 08:14 UTC

Return to Bug #72409 | Download this patch
This patch is obsolete

Obsoleted by patches:

This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2016-06-18 08:20 UTC | 2016-06-18 08:14 UTC | 2016-06-18 08:11 UTC

Developer: dave@mudsite.com


 From aaa123a375e17a08f2f441b932e6165899edeb64 Mon Sep 17 00:00:00 2001
 From 650a4f3709844111bc9f61453697b0896b712bdd Mon Sep 17 00:00:00 2001
  From: David Walker <dave@mudsite.com>
  Date: Sat, 18 Jun 2016 01:13:25 -0600
  Subject: [PATCH] Have pcntl_signal() return previously set handlers
  
  ---
   ext/pcntl/pcntl.c                 | 17 ++++++++++++++---
   ext/pcntl/tests/pcntl_signal.phpt |  7 ++++++-
  2 files changed, 20 insertions(+), 4 deletions(-)
  test.php                          | 13 +++++++++++++
  3 files changed, 33 insertions(+), 4 deletions(-)
  create mode 100644 test.php
  
  diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
  index 5592b31..e50913d 100644
  --- a/ext/pcntl/pcntl.c


  +string(4) "test"
   
   Warning: pcntl_signal() expects at least 2 parameters, 0 given in %s
   NULL
 diff --git a/test.php b/test.php
 new file mode 100644
 index 0000000..ee71390
 --- /dev/null
 +++ b/test.php
 @@ -0,0 +1,13 @@
 +<?php
 +function foo() {
 +}
 +function bar() {
 +}
 +
 +pcntl_signal(SIGUSR1, 'foo');
 +$func = pcntl_signal(SIGUSR1, 'bar');
 +var_dump($func);
 +
 +pcntl_signal(SIGUSR1, function($signo) {});
 +$func = pcntl_signal(SIGUSR1, 'bar');
 +var_dump($func);
  -- 
  2.8.1.217.ge6ac6e1
  
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 12:01:30 2024 UTC