Skip to content

Commit

Permalink
Merge branch 'PHP-5.5' into PHP-5.6
Browse files Browse the repository at this point in the history
* PHP-5.5:
  Fixed bug #61645 (fopen and O_NONBLOCK)
  fix possibly uninitialized value
  • Loading branch information
m6w6 committed Dec 6, 2013
2 parents f0248bd + a48d82d commit 9ea2489
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ext/dom/document.c
Expand Up @@ -2304,7 +2304,7 @@ PHP_FUNCTION(dom_document_save_html)
xmlBufferPtr buf;
dom_object *intern, *nodeobj;
xmlChar *mem = NULL;
int size, format;
int size = 0, format;
dom_doc_propsptr doc_props;

if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
Expand Down
12 changes: 7 additions & 5 deletions main/streams/plain_wrapper.c
Expand Up @@ -78,11 +78,7 @@ PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags)
/* unknown mode */
return FAILURE;
}
#if defined(O_NONBLOCK)
if (strchr(mode, 'n')) {
flags |= O_NONBLOCK;
}
#endif

if (strchr(mode, '+')) {
flags |= O_RDWR;
} else if (flags) {
Expand All @@ -91,6 +87,12 @@ PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags)
flags |= O_RDONLY;
}

#if defined(O_NONBLOCK)
if (strchr(mode, 'n')) {
flags |= O_NONBLOCK;
}
#endif

#if defined(_O_TEXT) && defined(O_BINARY)
if (strchr(mode, 't')) {
flags |= _O_TEXT;
Expand Down

0 comments on commit 9ea2489

Please sign in to comment.