Skip to content

Commit 4c0d2b6

Browse files
committed
Promote warning to exception in ext/posix
1 parent 517c993 commit 4c0d2b6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

ext/posix/posix.c

+2-7
Original file line numberDiff line numberDiff line change
@@ -655,14 +655,9 @@ PHP_FUNCTION(posix_mknod)
655655
}
656656

657657
if ((mode & S_IFCHR) || (mode & S_IFBLK)) {
658-
if (ZEND_NUM_ARGS() == 2) {
659-
php_error_docref(NULL, E_WARNING, "For S_IFCHR and S_IFBLK you need to pass a major device kernel identifier");
660-
RETURN_FALSE;
661-
}
662658
if (major == 0) {
663-
php_error_docref(NULL, E_WARNING,
664-
"Expects argument 3 to be non-zero for POSIX_S_IFCHR and POSIX_S_IFBLK");
665-
RETURN_FALSE;
659+
zend_argument_value_error(3, "cannot be 0 for the POSIX_S_IFCHR and POSIX_S_IFBLK modes");
660+
RETURN_THROWS();
666661
} else {
667662
#if defined(HAVE_MAKEDEV) || defined(makedev)
668663
php_dev = makedev(major, minor);

0 commit comments

Comments
 (0)