]> granicus.if.org Git - php/commitdiff
- Fixed bug #47816 (pcntl tests failing on NetBSD)
authorMatteo Beccati <mbeccati@php.net>
Sat, 28 Mar 2009 03:17:31 +0000 (03:17 +0000)
committerMatteo Beccati <mbeccati@php.net>
Sat, 28 Mar 2009 03:17:31 +0000 (03:17 +0000)
# Tests will still fail until a few kernel bugs are fixed

ext/pcntl/pcntl.c

index 414446a0497658c600a030e6c7274bb02577b44d..58d05502fc772ee87535b46aeda70a16fb4d897d 100755 (executable)
@@ -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);