summaryrefslogtreecommitdiff
path: root/ext/posix/posix.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2005-01-28 00:26:07 +0000
committerAntony Dovgal <tony2001@php.net>2005-01-28 00:26:07 +0000
commit37ebffee0cb1a16c23801911c71a3e78225a333c (patch)
treea03127bf182e2571f84f6c5b483d7736435eb849 /ext/posix/posix.c
parent4acc981ac4fccdd859882f33ddbc51d29a2ff28e (diff)
downloadphp-git-37ebffee0cb1a16c23801911c71a3e78225a333c.tar.gz
fix posix_getsid() & posix_getpgid()
/* looks like copy&paste error first introduced in PHP 3.0.10 (!) */
Diffstat (limited to 'ext/posix/posix.c')
-rw-r--r--ext/posix/posix.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/ext/posix/posix.c b/ext/posix/posix.c
index 107c38d26a..a7d2fd9638 100644
--- a/ext/posix/posix.c
+++ b/ext/posix/posix.c
@@ -371,7 +371,16 @@ PHP_FUNCTION(posix_setpgid)
#ifdef HAVE_GETPGID
PHP_FUNCTION(posix_getpgid)
{
- PHP_POSIX_SINGLE_ARG_FUNC(getpgid);
+ long val;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) {
+ return;
+ }
+
+ if ((val = getpgid(val)) < 0) {
+ POSIX_G(last_error) = errno;
+ RETURN_FALSE;
+ }
+ RETURN_LONG(val);
}
#endif
/* }}} */
@@ -381,7 +390,16 @@ PHP_FUNCTION(posix_getpgid)
#ifdef HAVE_GETSID
PHP_FUNCTION(posix_getsid)
{
- PHP_POSIX_SINGLE_ARG_FUNC(getsid);
+ long val;
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &val) == FAILURE) {
+ return;
+ }
+
+ if ((val = getsid(val)) < 0) {
+ POSIX_G(last_error) = errno;
+ RETURN_FALSE;
+ }
+ RETURN_LONG(val);
}
#endif
/* }}} */