Skip to content

Commit e23bc2d

Browse files
committed
Linux-specific iptype validation
1 parent dfe3bfe commit e23bc2d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ext/pcntl/pcntl.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,17 @@ PHP_FUNCTION(pcntl_waitid)
403403
Z_PARAM_LONG(options)
404404
ZEND_PARSE_PARAMETERS_END();
405405

406+
#ifdef __linux__
406407
if (idtype != P_ALL && idtype != P_PID && idtype != P_PGID && idtype != P_PIDFD) {
407408
zend_argument_value_error(1, "must be one of P_ALL, P_PID, P_PGID, P_PIDFD");
408409
RETURN_THROWS();
409410
}
411+
#else
412+
if (idtype != P_ALL && idtype != P_PID && idtype != P_PGID) {
413+
zend_argument_value_error(1, "must be one of P_ALL, P_PID, P_PGID");
414+
RETURN_THROWS();
415+
}
416+
#endif
410417

411418
if ((options & WEXITED) != WEXITED &&
412419
(options & WSTOPPED) != WSTOPPED &&

0 commit comments

Comments
 (0)