Skip to content

Commit

Permalink
Promote warning to exception in ext/posix
Browse files Browse the repository at this point in the history
Closes GH-6009
  • Loading branch information
kocsismate committed Aug 24, 2020
1 parent cc35cfd commit ffff237
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions ext/posix/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ffff237

Please sign in to comment.