From ffff23749744bc5390459987c90e9a7fb8a289d2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 18 Aug 2020 14:24:46 +0200 Subject: [PATCH] Promote warning to exception in ext/posix Closes GH-6009 --- ext/posix/posix.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ext/posix/posix.c b/ext/posix/posix.c index cc3dd42cbc..bb86b5324b 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -655,14 +655,9 @@ PHP_FUNCTION(posix_mknod) } if ((mode & S_IFCHR) || (mode & S_IFBLK)) { - if (ZEND_NUM_ARGS() == 2) { - php_error_docref(NULL, E_WARNING, "For S_IFCHR and S_IFBLK you need to pass a major device kernel identifier"); - RETURN_FALSE; - } if (major == 0) { - php_error_docref(NULL, E_WARNING, - "Expects argument 3 to be non-zero for POSIX_S_IFCHR and POSIX_S_IFBLK"); - RETURN_FALSE; + zend_argument_value_error(3, "cannot be 0 for the POSIX_S_IFCHR and POSIX_S_IFBLK modes"); + RETURN_THROWS(); } else { #if defined(HAVE_MAKEDEV) || defined(makedev) php_dev = makedev(major, minor); -- 2.40.0