if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) {
bz_file = BZ2_bzdopen(fd, mode);
}
- stream->flags |= PHP_STREAM_FLAG_FCLOSE;
}
/* remove the file created by php_stream_open_wrapper(), it is not needed since BZ2 functions
if (bz_file) {
retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC TSRMLS_CC);
if (retstream) {
- retstream->flags |= PHP_STREAM_FLAG_FCLOSE;
return retstream;
}
if (dirp == NULL) {
goto opendir_cleanup;
}
+
+ dirp->flags |= PHP_STREAM_FLAG_NO_FCLOSE;
php_set_default_dir(dirp->rsrc_id TSRMLS_CC);
stream = php_stream_fopen_tmpfile();
if (stream) {
- stream->flags |= PHP_STREAM_FLAG_FCLOSE;
-
php_stream_to_zval(stream, return_value);
} else {
RETURN_FALSE;
RETURN_FALSE;
}
- stream->flags |= PHP_STREAM_FLAG_FCLOSE;
-
php_stream_to_zval(stream, return_value);
}
/* }}} */
PHP_STREAM_TO_ZVAL(stream, arg1);
- if (!(stream->flags & PHP_STREAM_FLAG_FCLOSE)) {
+ if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a valid stream resource", stream->rsrc_id);
RETURN_FALSE;
}
stream = php_stream_xport_create(hostname, hostname_len, REPORT_ERRORS,
STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, hashkey, &tv, NULL, &errstr, &err);
- stream->flags |= PHP_STREAM_FLAG_FCLOSE;
-
if (port > 0) {
efree(hostname);
}
zval *retfp;
/* nasty hack; don't copy it */
- stream->flags |= PHP_STREAM_FLAG_NO_SEEK | PHP_STREAM_FLAG_FCLOSE;
+ stream->flags |= PHP_STREAM_FLAG_NO_SEEK;
if (UG(unicode) && !binary_pipes) {
if (write_stream) {
RETURN_FALSE;
}
- stream->flags |= PHP_STREAM_FLAG_FCLOSE;
-
if (errstr) {
efree(errstr);
}
STREAM_XPORT_SERVER | flags,
NULL, NULL, context, &errstr, &err);
- stream->flags |= PHP_STREAM_FLAG_FCLOSE;
-
if (stream == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to connect to %s (%s)", host, errstr == NULL ? "Unknown error" : errstr);
}
&tv, &errstr
TSRMLS_CC) && clistream) {
- clistream->flags |= PHP_STREAM_FLAG_FCLOSE;
-
if (peername) {
ZVAL_RT_STRINGL(zpeername, peername, peername_len, ZSTR_AUTOFREE);
}
if (!stream) {
return NULL;
} else {
- stream->flags |= PHP_STREAM_FLAG_FCLOSE;
return stream;
}
#define PHP_STREAM_FLAG_IS_DIR 64
-#define PHP_STREAM_FLAG_FCLOSE 128
+#define PHP_STREAM_FLAG_NO_FCLOSE 128
struct _php_stream {
php_stream_ops *ops;
return;
}
- s_in->flags |= PHP_STREAM_FLAG_FCLOSE;
- s_out->flags |= PHP_STREAM_FLAG_FCLOSE;
- s_err->flags |= PHP_STREAM_FLAG_FCLOSE;
-
#if PHP_DEBUG
/* do not close stdout and stderr */
s_out->flags |= PHP_STREAM_FLAG_NO_CLOSE;