summaryrefslogtreecommitdiff
path: root/main/streams/plain_wrapper.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-11-18 21:18:52 +0100
committerAnatol Belski <ab@php.net>2014-11-18 21:18:52 +0100
commitc6bad96f306df8e8b656472e618283ced5083cdb (patch)
tree7e5b52aa07777f0336b0944a228bf66f8f56b31f /main/streams/plain_wrapper.c
parent4262663e4caa82ba17666781a95bdcb872b4e109 (diff)
parent64a39dc7b07d4b54d050a3a5c15045fe91c0b651 (diff)
downloadphp-git-c6bad96f306df8e8b656472e618283ced5083cdb.tar.gz
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (398 commits) NEWS add test for bug #68381 Fixed bug #68381 Set FPM log level earlier during init proper dllexport move to size_t where zend_string is used internally fix some datatype mismatches return after the warning, to fix uninitialized salt usage fix datatype mismatches add missing type specifier fix datatype mismatches fix unsigned check "extern" shouldn't be used for definitions joined identical conditional blocks simplify fpm tests SEND_VAR_NO_REF optimization Add test for bug #68442 Add various tests for FPM - covering recent bugs (68420, 68421, 68423, 68428) - for UDS - for ping and status URI - for multi pool and multi mode Include small MIT FastCGI client library from https://github.com/adoy/PHP-FastCGI-Client Get rid of zend_free_op structure (use zval* instead). Get rid of useless TSRMLS arguments. Add new FPM test for IPv4/IPv6 ... Conflicts: win32/build/config.w32
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r--main/streams/plain_wrapper.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 7432b7c49e..8590647818 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -325,7 +325,11 @@ static size_t php_stdiop_write(php_stream *stream, const char *buf, size_t count
assert(data != NULL);
if (data->fd >= 0) {
+#ifdef PHP_WIN32
+ int bytes_written = write(data->fd, buf, (unsigned int)count);
+#else
int bytes_written = write(data->fd, buf, count);
+#endif
if (bytes_written < 0) return 0;
return (size_t) bytes_written;
} else {
@@ -776,8 +780,8 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void
GetSystemInfo(&info);
gran = info.dwAllocationGranularity;
- loffs = (range->offset / gran) * gran;
- delta = range->offset - loffs;
+ loffs = ((DWORD)range->offset / gran) * gran;
+ delta = (DWORD)range->offset - loffs;
}
data->last_mapped_addr = MapViewOfFile(data->file_mapping, acc, 0, loffs, range->length + delta);
@@ -1099,11 +1103,11 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f
}
#ifdef PHP_WIN32
- if (!php_win32_check_trailing_space(url_from, strlen(url_from))) {
+ if (!php_win32_check_trailing_space(url_from, (int)strlen(url_from))) {
php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to TSRMLS_CC);
return 0;
}
- if (!php_win32_check_trailing_space(url_to, strlen(url_to))) {
+ if (!php_win32_check_trailing_space(url_to, (int)strlen(url_to))) {
php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to TSRMLS_CC);
return 0;
}
@@ -1195,7 +1199,7 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i
/* we look for directory separator from the end of string, thus hopefuly reducing our work load */
char *e;
zend_stat_t sb;
- int dir_len = strlen(dir);
+ int dir_len = (int)strlen(dir);
int offset = 0;
char buf[MAXPATHLEN];
@@ -1269,7 +1273,7 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char *dir, i
static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, int options, php_stream_context *context TSRMLS_DC)
{
#if PHP_WIN32
- int url_len = strlen(url);
+ int url_len = (int)strlen(url);
#endif
if (php_check_open_basedir(url TSRMLS_CC)) {
return 0;
@@ -1304,7 +1308,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
mode_t mode;
int ret = 0;
#if PHP_WIN32
- int url_len = strlen(url);
+ int url_len = (int)strlen(url);
#endif
#if PHP_WIN32
@@ -1395,7 +1399,7 @@ static php_stream_wrapper_ops php_plain_files_wrapper_ops = {
php_plain_files_metadata
};
-php_stream_wrapper php_plain_files_wrapper = {
+PHPAPI php_stream_wrapper php_plain_files_wrapper = {
&php_plain_files_wrapper_ops,
NULL,
0
@@ -1422,7 +1426,7 @@ PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char
return NULL;
}
- filename_length = strlen(filename);
+ filename_length = (int)strlen(filename);
/* Relative path open */
if (*filename == '.' && (IS_SLASH(filename[1]) || filename[1] == '.')) {
@@ -1487,8 +1491,8 @@ not_relative_path:
*/
if (zend_is_executing(TSRMLS_C)) {
exec_fname = zend_get_executed_filename(TSRMLS_C);
- exec_fname_length = strlen(exec_fname);
- path_length = strlen(path);
+ exec_fname_length = (int)strlen(exec_fname);
+ path_length = (int)strlen(path);
while ((--exec_fname_length >= 0) && !IS_SLASH(exec_fname[exec_fname_length]));
if ((exec_fname && exec_fname[0] == '[')