From 6bf4c001427c3ed193f059a35274f14963126bca Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Sat, 28 Mar 2009 03:17:31 +0000 Subject: [PATCH] - Fixed bug #47816 (pcntl tests failing on NetBSD) # Tests will still fail until a few kernel bugs are fixed --- ext/pcntl/pcntl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 414446a049..58d05502fc 100755 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -924,6 +924,14 @@ static void pcntl_sigwaitinfo(INTERNAL_FUNCTION_PARAMETERS, int timedwait) /* {{ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno)); } + /* + * sigtimedwait and sigwaitinfo can return 0 on success on some + * platforms, e.g. NetBSD + */ + if (!signo && siginfo.si_signo) { + signo = siginfo.si_signo; + } + if (signo > 0 && user_siginfo) { if (Z_TYPE_P(user_siginfo) != IS_ARRAY) { zval_dtor(user_siginfo); -- 2.40.0