summaryrefslogtreecommitdiff
path: root/ext/posix
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-08-18 14:24:46 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-08-24 17:34:33 +0200
commitffff23749744bc5390459987c90e9a7fb8a289d2 (patch)
treecfe41a4d0629142bc464e7f091f5e3dbaf766a53 /ext/posix
parentcc35cfd2eb95eeacfa11e9f4b824d0ec1c43ec39 (diff)
downloadphp-git-ffff23749744bc5390459987c90e9a7fb8a289d2.tar.gz
Promote warning to exception in ext/posix
Closes GH-6009
Diffstat (limited to 'ext/posix')
-rw-r--r--ext/posix/posix.c9
1 files 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);