summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Fischer <mfischer@php.net>2002-03-21 22:35:02 +0000
committerMarkus Fischer <mfischer@php.net>2002-03-21 22:35:02 +0000
commit1d75089d8bf0349ea56b449e6e9c1ac656bdb859 (patch)
tree1255c6b271aa57c4636221cb33c3fad3f9cb1f5c
parent9772468d37096ea7c5b551b78491c5a597ffdd25 (diff)
downloadphp-git-1d75089d8bf0349ea56b449e6e9c1ac656bdb859.tar.gz
*** empty log message ***
-rw-r--r--ext/curl/curl.c2
-rw-r--r--ext/gd/gd.c4
-rw-r--r--ext/pdf/pdf.c2
-rw-r--r--ext/pgsql/pgsql.c2
-rw-r--r--ext/recode/recode.c4
-rwxr-xr-xmain/streams.c2
6 files changed, 9 insertions, 7 deletions
diff --git a/ext/curl/curl.c b/ext/curl/curl.c
index 82a707139a..83c3739e5b 100644
--- a/ext/curl/curl.c
+++ b/ext/curl/curl.c
@@ -705,7 +705,7 @@ PHP_FUNCTION(curl_setopt)
what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream());
ZEND_VERIFY_RESOURCE(what);
- if (!php_stream_cast((php_stream*)what, PHP_STREAM_AS_STDIO, (void*)&fp, REPORT_ERRORS))
+ if (FAILURE == php_stream_cast((php_stream*)what, PHP_STREAM_AS_STDIO, (void*)&fp, REPORT_ERRORS))
RETURN_FALSE;
if (!fp) {
RETURN_FALSE;
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 93766aa1c2..b64306d27d 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1161,7 +1161,9 @@ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type,
/* try and avoid allocating a FILE* if the stream is not naturally a FILE* */
if (php_stream_is(stream, PHP_STREAM_IS_STDIO)) {
- php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void**)&fp, REPORT_ERRORS);
+ if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void**)&fp, REPORT_ERRORS)) {
+ goto out_err;
+ }
}
else if (ioctx_func_p) {
#ifdef USE_GD_IOCTX
diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c
index 4b6a888563..fbc772fa63 100644
--- a/ext/pdf/pdf.c
+++ b/ext/pdf/pdf.c
@@ -479,7 +479,7 @@ PHP_FUNCTION(pdf_open)
what = zend_fetch_resource(file TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream());
ZEND_VERIFY_RESOURCE(what);
- if (!php_stream_cast((php_stream*)what, PHP_STREAM_AS_STDIO, (void*)&fp, 1) == FAILURE) {
+ if (php_stream_cast((php_stream*)what, PHP_STREAM_AS_STDIO, (void*)&fp, 1) == FAILURE) {
RETURN_FALSE;
}
/* XXX should do a zend_list_addref for <fp> here! */
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index e795affba4..8038c72fab 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1478,7 +1478,7 @@ PHP_FUNCTION(pg_trace)
RETURN_FALSE;
}
- if (!php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void**)fp, REPORT_ERRORS)) {
+ if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void**)fp, REPORT_ERRORS)) {
php_stream_close(stream);
RETURN_FALSE;
}
diff --git a/ext/recode/recode.c b/ext/recode/recode.c
index f502827ef6..048b4f4896 100644
--- a/ext/recode/recode.c
+++ b/ext/recode/recode.c
@@ -181,7 +181,7 @@ PHP_FUNCTION(recode_file)
RETURN_FALSE;
}
- if (!php_stream_cast(instream, PHP_STREAM_AS_STDIO, (void**)&in_fp, REPORT_ERRORS)) {
+ if (FAILURE == php_stream_cast(instream, PHP_STREAM_AS_STDIO, (void**)&in_fp, REPORT_ERRORS)) {
RETURN_FALSE;
}
@@ -191,7 +191,7 @@ PHP_FUNCTION(recode_file)
php_error(E_WARNING,"Unable to find output file identifier");
RETURN_FALSE;
}
- if (!php_stream_cast(outstream, PHP_STREAM_AS_STDIO, (void**)&out_fp, REPORT_ERRORS)) {
+ if (FAILURE == php_stream_cast(outstream, PHP_STREAM_AS_STDIO, (void**)&out_fp, REPORT_ERRORS)) {
RETURN_FALSE;
}
diff --git a/main/streams.c b/main/streams.c
index 0a0f3a32e2..498a6aa7bf 100755
--- a/main/streams.c
+++ b/main/streams.c
@@ -297,7 +297,7 @@ PHPAPI size_t _php_stream_passthru(php_stream * stream STREAMS_DC TSRMLS_DC)
#ifdef HAVE_MMAP
if (!php_stream_is(stream, PHP_STREAM_IS_SOCKET)
- && php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fd, 0))
+ && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void*)&fd, 0))
{
struct stat sbuf;
off_t off;