wez Thu Sep 9 15:41:08 2004 EDT
Modified files:
/php-src/ext/standard file.c
Log:
avoid ANSI stdio when calling tempnam() to avoid limitations of AT&T libc.
http://cvs.php.net/diff.php/php-src/ext/standard/file.c?r1=1.385&r2=1.386&ty=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.385 php-src/ext/standard/file.c:1.386
--- php-src/ext/standard/file.c:1.385 Sun Sep 5 09:27:58 2004
+++ php-src/ext/standard/file.c Thu Sep 9 15:41:07 2004
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.385 2004/09/05 13:27:58 andrey Exp $ */
+/* $Id: file.c,v 1.386 2004/09/09 19:41:07 wez Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -704,7 +704,7 @@
char *d;
char *opened_path;
char p[64];
- FILE *fp;
+ int fd;
if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) ==
FAILURE) {
WRONG_PARAM_COUNT;
@@ -719,8 +719,8 @@
d = estrndup(Z_STRVAL_PP(arg1), Z_STRLEN_PP(arg1));
strlcpy(p, Z_STRVAL_PP(arg2), sizeof(p));
- if ((fp = php_open_temporary_file(d, p, &opened_path TSRMLS_CC))) {
- fclose(fp);
+ if ((fd = php_open_temporary_fd(d, p, &opened_path TSRMLS_CC)) >= 0) {
+ close(fd);
RETVAL_STRING(opened_path, 0);
} else {
RETVAL_FALSE;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php