]> granicus.if.org Git - php/commitdiff
*** empty log message ***
authorMarkus Fischer <mfischer@php.net>
Thu, 21 Mar 2002 22:35:02 +0000 (22:35 +0000)
committerMarkus Fischer <mfischer@php.net>
Thu, 21 Mar 2002 22:35:02 +0000 (22:35 +0000)
ext/curl/curl.c
ext/gd/gd.c
ext/pdf/pdf.c
ext/pgsql/pgsql.c
ext/recode/recode.c
main/streams.c

index 82a707139a9653998dbcf751b2737c9ff63bff46..83c3739e5b228b10dccde071cec8a169f8cd5a3d 100644 (file)
@@ -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;
index 93766aa1c245e9958359e7fec8fc8328dbe2d4b6..b64306d27de03507eed7aad163ea38227d01e2b1 100644 (file)
@@ -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
index 4b6a888563969b5383133e37c602b7adbbe094fa..fbc772fa632dab564410d52a4e05b77fae58da5b 100644 (file)
@@ -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! */
index e795affba4c1bc256c076111618d57b96ab6339d..8038c72fabada64afd1274fcccf5483442d455f8 100644 (file)
@@ -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;
        }
index f502827ef68f58a8cde1f906ce7311371fe94ae8..048b4f489681dd9438c130382ce691e5588da10e 100644 (file)
@@ -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;
        }
        
index 0a0f3a32e2e648965f13e800f6db7ef62f110ca0..498a6aa7bfe7e387dc7c59bc719a35a4f3d3196d 100755 (executable)
@@ -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;