cvs: php4(PHP_4_3) /main streams.c
| From: | Wez Furlong | Date: | Wed, 14 May 2003 18:38:02 +0000 |
| Subject: | cvs: php4(PHP_4_3) /main streams.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20913@lists.php.net to get a copy of this message | ||
wez Wed May 14 14:38:02 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/main streams.c
Log:
Avoid warning about casting as FD when including. This fixes the
fopencookie/userstream/include test.
Add label for new selectable descriptor cast mode.
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.125.2.55 php4/main/streams.c:1.125.2.56
--- php4/main/streams.c:1.125.2.55 Tue May 13 19:09:27 2003
+++ php4/main/streams.c Wed May 14 14:38:01 2003
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.125.2.55 2003/05/13 23:09:27 sas Exp $ */
+/* $Id: streams.c,v 1.125.2.56 2003/05/14 18:38:01 wez Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -2223,7 +2223,7 @@
if (show_err) {
/* these names depend on the values of the PHP_STREAM_AS_XXX defines in php_streams.h */
static const char *cast_names[3] = {
- "STDIO FILE*", "File Descriptor", "Socket Descriptor"
+ "STDIO FILE*", "File Descriptor", "Socket Descriptor",
"select()able descriptor"
};
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot represent a stream of type %s as a
%s",
@@ -2716,7 +2716,8 @@
if (stream == NULL)
return FAILURE;
- if (php_stream_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_TRY_HARD
+ if (php_stream_can_cast(stream, PHP_STREAM_AS_FD) == SUCCESS &&
+ php_stream_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_TRY_HARD
| PHP_STREAM_CAST_RELEASE, (void **) &fh->handle.fd,
REPORT_ERRORS) == SUCCESS) {
if ((options & STREAM_OPEN_FOR_INCLUDE)