diff options
Diffstat (limited to 'main/streams/plain_wrapper.c')
| -rw-r--r-- | main/streams/plain_wrapper.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 25eacceec5..a5429138f3 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -51,7 +51,7 @@ #define php_stream_fopen_from_file_int(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_CC) #define php_stream_fopen_from_file_int_rel(file, mode) _php_stream_fopen_from_file_int((file), (mode) STREAMS_REL_CC) -#if !defined(WINDOWS) && !defined(NETWARE) +#ifndef PHP_WIN32 extern int php_get_uid_by_name(const char *name, uid_t *uid); extern int php_get_gid_by_name(const char *name, gid_t *gid); #endif @@ -1007,7 +1007,7 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, zen /* fall through */ case PHP_STREAM_PERSISTENT_FAILURE: - efree(persistent_id);; + efree(persistent_id); return ret; } } @@ -1139,11 +1139,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, (int)strlen(url_from))) { + if (!php_win32_check_trailing_space(url_from, strlen(url_from))) { php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to); return 0; } - if (!php_win32_check_trailing_space(url_to, (int)strlen(url_to))) { + if (!php_win32_check_trailing_space(url_to, strlen(url_to))) { php_win32_docref2_from_error(ERROR_INVALID_NAME, url_from, url_to); return 0; } @@ -1170,7 +1170,7 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, const char *url_f zend_stat_t sb; if (php_copy_file(url_from, url_to) == SUCCESS) { if (VCWD_STAT(url_from, &sb) == 0) { -# if !defined(TSRM_WIN32) && !defined(NETWARE) +# ifndef TSRM_WIN32 if (VCWD_CHMOD(url_to, sb.st_mode)) { if (errno == EPERM) { php_error_docref2(NULL, url_from, url_to, E_WARNING, "%s", strerror(errno)); @@ -1229,8 +1229,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 = (int)strlen(dir); - int offset = 0; + size_t dir_len = strlen(dir), offset = 0; char buf[MAXPATHLEN]; if (!expand_filepath_with_mode(dir, buf, NULL, 0, CWD_EXPAND )) { @@ -1311,7 +1310,7 @@ static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, i } #ifdef PHP_WIN32 - if (!php_win32_check_trailing_space(url, (int)strlen(url))) { + if (!php_win32_check_trailing_space(url, strlen(url))) { php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT)); return 0; } @@ -1331,18 +1330,15 @@ static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, i static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url, int option, void *value, php_stream_context *context) { struct utimbuf *newtime; -#if !defined(WINDOWS) && !defined(NETWARE) +#ifndef PHP_WIN32 uid_t uid; gid_t gid; #endif mode_t mode; int ret = 0; -#ifdef PHP_WIN32 - int url_len = (int)strlen(url); -#endif #ifdef PHP_WIN32 - if (!php_win32_check_trailing_space(url, url_len)) { + if (!php_win32_check_trailing_space(url, strlen(url))) { php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT)); return 0; } @@ -1370,7 +1366,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url ret = VCWD_UTIME(url, newtime); break; -#if !defined(WINDOWS) && !defined(NETWARE) +#ifndef PHP_WIN32 case PHP_STREAM_META_OWNER_NAME: case PHP_STREAM_META_OWNER: if(option == PHP_STREAM_META_OWNER_NAME) { @@ -1441,7 +1437,7 @@ PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char const char *ptr; char trypath[MAXPATHLEN]; php_stream *stream; - int filename_length; + size_t filename_length; zend_string *exec_filename; if (opened_path) { @@ -1452,7 +1448,7 @@ PHPAPI php_stream *_php_stream_fopen_with_path(const char *filename, const char return NULL; } - filename_length = (int)strlen(filename); + filename_length = strlen(filename); #ifndef PHP_WIN32 (void) filename_length; #endif |
