cvs: php4 / NEWS /ext/posix posix.c
| From: | Andi Gutmans | Date: | Thu, 05 Oct 2000 18:26:54 +0000 |
| Subject: | cvs: php4 / NEWS /ext/posix posix.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1941@lists.php.net to get a copy of this message | ||
andi Thu Oct 5 11:26:54 2000 EDT
Modified files:
/php4 NEWS
/php4/ext/posix posix.c
Log:
- Clean-up original code and add to NEWS.
Index: php4/NEWS
diff -u php4/NEWS:1.458 php4/NEWS:1.459
--- php4/NEWS:1.458 Tue Oct 3 10:08:41 2000
+++ php4/NEWS Thu Oct 5 11:26:54 2000
@@ -2,6 +2,7 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
05 Oct 2000, Version 4.0.3
+- Fixed crash in the POSIX getrlimit() function (alex@zend.com)
- Fixed dirname() under certain conditions (Andi)
- Add --with-imap-ssl to support SSL'ized imap library in RH7 and others
(Rasmus)
Index: php4/ext/posix/posix.c
diff -u php4/ext/posix/posix.c:1.23 php4/ext/posix/posix.c:1.24
--- php4/ext/posix/posix.c:1.23 Thu Oct 5 11:06:55 2000
+++ php4/ext/posix/posix.c Thu Oct 5 11:26:54 2000
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: posix.c,v 1.23 2000/10/05 18:06:55 sasha Exp $ */
+/* $Id: posix.c,v 1.24 2000/10/05 18:26:54 andi Exp $ */
#include "php.h"
@@ -138,7 +138,7 @@
static PHP_MINFO_FUNCTION(posix)
{
php_info_print_table_start();
- php_info_print_table_row(2, "Revision", "$Revision: 1.23 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.24 $");
php_info_print_table_end();
}
@@ -833,6 +833,9 @@
#ifdef HAVE_GETRLIMIT
+
+#define UNLIMITED_STRING "unlimited"
+
static int posix_addlimit(int limit, char *name, pval *return_value) {
int result;
struct rlimit rl;
@@ -848,15 +851,17 @@
return FAILURE;
}
- if (rl.rlim_cur == RLIM_INFINITY)
- add_assoc_string(return_value,soft,"unlimited", 1);
- else
- add_assoc_long(return_value,soft,rl.rlim_cur);
-
- if (rl.rlim_max == RLIM_INFINITY)
- add_assoc_string(return_value,hard,"unlimited", 1);
- else
- add_assoc_long(return_value,hard,rl.rlim_max);
+ if (rl.rlim_cur == RLIM_INFINITY) {
+ add_assoc_stringl(return_value, soft, UNLIMITED_STRING, sizeof(UNLIMITED_STRING)-1, 1);
+ } else {
+ add_assoc_long(return_value, soft, rl.rlim_cur);
+ }
+
+ if (rl.rlim_max == RLIM_INFINITY) {
+ add_assoc_stringl(return_value, hard, UNLIMITED_STRING, sizeof(UNLIMITED_STRING)-1, 1);
+ } else {
+ add_assoc_long(return_value, hard, rl.rlim_max);
+ }
return SUCCESS;
}