Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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