]> granicus.if.org Git - php/commitdiff
handle the stream->__exposed flag correctly
authorAnatol Belski <ab@php.net>
Thu, 6 Oct 2016 00:14:16 +0000 (02:14 +0200)
committerAnatol Belski <ab@php.net>
Thu, 6 Oct 2016 00:15:29 +0000 (02:15 +0200)
as it's a flag now, just set the value

main/php_streams.h

index f08e72b69b3e2dd818827ada83f174c0b558668b..82466163a29130691e534c90669f35d42dab9c75 100644 (file)
@@ -253,11 +253,11 @@ END_EXTERN_C()
 
 #define php_stream_get_resource_id(stream)             ((php_stream *)(stream))->res->handle
 /* use this to tell the stream that it is OK if we don't explicitly close it */
-#define php_stream_auto_cleanup(stream)        { (stream)->__exposed++; }
+#define php_stream_auto_cleanup(stream)        { (stream)->__exposed = 1; }
 /* use this to assign the stream to a zval and tell the stream that is
  * has been exported to the engine; it will expect to be closed automatically
  * when the resources are auto-destructed */
-#define php_stream_to_zval(stream, zval)       { ZVAL_RES(zval, (stream)->res); (stream)->__exposed++; }
+#define php_stream_to_zval(stream, zval)       { ZVAL_RES(zval, (stream)->res); (stream)->__exposed = 1; }
 
 #define php_stream_from_zval(xstr, pzval)      do { \
        if (((xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), \