summaryrefslogtreecommitdiff
path: root/main/php_streams.h
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2015-06-30 03:49:54 +0200
committerBob Weinand <bobwei9@hotmail.com>2015-06-30 03:49:54 +0200
commit6ad9cd5367734276d624d6d2a03406ed0d0cd08b (patch)
treeba04d82653fcddb1d294a836930335b58011c1f2 /main/php_streams.h
parent4a2e40bb861bc3cf5fb6863e57486ed60316e97c (diff)
downloadphp-git-6ad9cd5367734276d624d6d2a03406ed0d0cd08b.tar.gz
Only call stream_flush if anything was written
This avoids flushing in readonly mode upon close
Diffstat (limited to 'main/php_streams.h')
-rw-r--r--main/php_streams.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/main/php_streams.h b/main/php_streams.h
index 0ee3ff5458..81822a7076 100644
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -166,24 +166,26 @@ struct _php_stream_wrapper {
int is_url; /* so that PG(allow_url_fopen) can be respected */
};
-#define PHP_STREAM_FLAG_NO_SEEK 1
-#define PHP_STREAM_FLAG_NO_BUFFER 2
+#define PHP_STREAM_FLAG_NO_SEEK 0x1
+#define PHP_STREAM_FLAG_NO_BUFFER 0x2
-#define PHP_STREAM_FLAG_EOL_UNIX 0 /* also includes DOS */
-#define PHP_STREAM_FLAG_DETECT_EOL 4
-#define PHP_STREAM_FLAG_EOL_MAC 8
+#define PHP_STREAM_FLAG_EOL_UNIX 0x0 /* also includes DOS */
+#define PHP_STREAM_FLAG_DETECT_EOL 0x4
+#define PHP_STREAM_FLAG_EOL_MAC 0x8
/* set this when the stream might represent "interactive" data.
* When set, the read buffer will avoid certain operations that
* might otherwise cause the read to block for much longer than
* is strictly required. */
-#define PHP_STREAM_FLAG_AVOID_BLOCKING 16
+#define PHP_STREAM_FLAG_AVOID_BLOCKING 0x10
-#define PHP_STREAM_FLAG_NO_CLOSE 32
+#define PHP_STREAM_FLAG_NO_CLOSE 0x20
-#define PHP_STREAM_FLAG_IS_DIR 64
+#define PHP_STREAM_FLAG_IS_DIR 0x40
-#define PHP_STREAM_FLAG_NO_FCLOSE 128
+#define PHP_STREAM_FLAG_NO_FCLOSE 0x80
+
+#define PHP_STREAM_FLAG_WAS_WRITTEN 0x80000000
struct _php_stream {
php_stream_ops *ops;